Views
No views yet
| Metric | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Architecture | Mixture-of-Experts Transformer |
| Total Parameters | ~17.3B (pruned from 21B) |
| Original Experts per Layer | 32 |
| Pruned Experts per Layer | 26 |
| Layers | 24 |
| Top-k Routing | 4 |
| Context Length | 128K tokens |
| Attention Heads | 64 (Query), 8 (Key-Value) |
| Residual Dimension | 2880 |
| Attention Pattern | Alternating dense & sliding window (128 tokens) |
| Positional Encoding | RoPE (Rotary Position Embedding) |
| Normalization | RMSNorm |
| Precision | BF16 |
| License | Apache 2.0 |
| Specialization | Science |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Load the specialized model on CPU
5model = AutoModelForCausalLM.from_pretrained(
6 "AmanPriyanshu/gpt-oss-17.3b-specialized-science-pruned-moe-only-26-experts",
7 torch_dtype=torch.bfloat16,
8 device_map="cpu",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-17.3b-specialized-science-pruned-moe-only-26-experts")
12
13# Generate with the model
14messages = [
15 {"role": "user", "content": "Explain the process of photosynthesis in plants."}
16]
17
18inputs = tokenizer.apply_chat_template(
19 messages,
20 add_generation_prompt=True,
21 return_tensors="pt",
22 return_dict=True,
23 reasoning_effort="medium"
24)
25
26# Ensure inputs are on the same device as model
27inputs = {k: v.to(model.device) for k, v in inputs.items()}
28
29outputs = model.generate(
30 **inputs,
31 max_new_tokens=512,
32 do_sample=True,
33 temperature=0.1,
34 top_p=0.9,
35 pad_token_id=tokenizer.eos_token_id,
36 eos_token_id=tokenizer.eos_token_id
37)
38
39# Decode only the generated part
40input_length = inputs['input_ids'].shape[1]
41response_tokens = outputs[0][input_length:]
42response = tokenizer.decode(response_tokens, skip_special_tokens=True)
43print(response)1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Check MPS availability and load model
5device = "mps" if torch.backends.mps.is_available() else "cpu"
6
7model = AutoModelForCausalLM.from_pretrained(
8 "AmanPriyanshu/gpt-oss-17.3b-specialized-science-pruned-moe-only-26-experts",
9 torch_dtype=torch.float16, # Better MPS compatibility
10 device_map=device,
11 trust_remote_code=True,
12 low_cpu_mem_usage=True
13)
14tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-17.3b-specialized-science-pruned-moe-only-26-experts")
15
16# Generate with the model
17messages = [
18 {"role": "user", "content": "Explain the process of photosynthesis in plants."}
19]
20
21inputs = tokenizer.apply_chat_template(
22 messages,
23 add_generation_prompt=True,
24 return_tensors="pt",
25 return_dict=True,
26 reasoning_effort="medium"
27)
28
29# Move inputs to model device
30inputs = {k: v.to(model.device) if isinstance(v, torch.Tensor) else v for k, v in inputs.items()}
31
32# Use torch.no_grad for MPS stability
33with torch.no_grad():
34 outputs = model.generate(
35 **inputs,
36 max_new_tokens=512,
37 do_sample=True,
38 temperature=0.1,
39 top_p=0.9,
40 pad_token_id=tokenizer.eos_token_id,
41 eos_token_id=tokenizer.eos_token_id,
42 use_cache=True
43 )
44
45# Decode only the generated part
46input_length = inputs['input_ids'].shape[1]
47response_tokens = outputs[0][input_length:]
48response = tokenizer.decode(response_tokens, skip_special_tokens=True)
49print(response)1device_map="auto" # Will automatically use GPU if available
2torch_dtype=torch.bfloat16 # or torch.float16<|channel|>analysis<|message|>Need concise explanation.<|end|><|start|>assistant<|channel|>final<|message|>**Photosynthesis in Plants – A Step‑by‑Step Overview**
| **Stage** | **What Happens** | **Key Players** | **Result** |
|-----------|------------------|-----------------|------------|
| 1. **Light Capture** | Sunlight hits chlorophyll‑a and chlorophyll‑b in the thylakoid membranes of chloroplasts. | *Light‑harvesting complexes (LHCs)*, *chlorophyll pigments* | Excited electrons are generated. |
| 2. **Water Splitting (Photolysis)** | The oxygen‑evolving complex (OEC) splits H₂O into O₂, 4 H⁺, and 4 e⁻. | *Oxygen‑evolving complex (Mn‑Ca cluster)* | O₂ released to atmosphere; electrons enter the electron transport chain. |
| 3. **Electron Transport Chain (ETC)** | Excited electrons travel through Photosystem II → plastoquinone → cytochrome b₆f → Photosystem I → plastocyanin → NADP⁺ reductase. | *Photosystem II (PSII)*, *Photosystem I (PSI)*, *plastoquinone*, *cytochrome b₆f*, *plastocyanin*, *NADP⁺ reductase* | Generates a proton gradient (ΔpH) across the thylakoid membrane. |
| 4. **ATP Synthesis (Photophosphorylation)** | Protons flow back through ATP synthase, driving ATP formation. | *ATP synthase (CF₀/CF₁)* | 3 ATP per NADPH produced. |
| 5. **NADPH Production** | Electrons reduce NADP⁺ to NADPH at the end of the ETC. | *NADP⁺ reductase* | NADPH carries reducing power to the Calvin cycle. |
| 6. **Calvin Cycle (Carbon Fixation)** | CO₂ is fixed into 3‑phosphoglycerate (3‑PGA) by Rubisco, then reduced to glyceraldehyde‑3‑phosphate (G3P) using ATP & NADPH. | *Rubisco*, *phosphoglycerate kinase*, *G3P dehydrogenase*, *phosphoglycerate mutase*, *enolase*,<|channel|>analysis<|message|>Need explain greenhouse effect, causes, mechanism.<|end|><|start|>assistant<|channel|>final<|message|>### What is the Greenhouse Effect?
The **greenhouse effect** is the natural process that warms the Earth’s surface to a temperature that can support life. It occurs when certain gases in the atmosphere trap heat that would otherwise escape into space. Without this effect, the planet would be about 33 °C (59 °F) colder on average.
---
## 1. What Causes the Greenhouse Effect?
| **Primary Greenhouse Gases** | **Key Properties** | **Sources** |
|------------------------------|---------------------|--------------|
| **Water vapor (H₂O)** | Most abundant, highly variable | Evaporation from oceans, lakes, plants |
| **Carbon dioxide (CO₂)** | Long‑lived, well‑mixed | Fossil‑fuel combustion, deforestation, cement production |
| **Methane (CH₄)** | Strong absorber, short lifetime | Agriculture (livestock, rice paddies), landfills, natural gas leaks |
| **Nitrous oxide (N₂O)** | Long‑lived, potent | Agriculture (fertilizers), industrial processes |
| **Ozone (O₃)** | Absorbs UV and IR | Natural photochemical reactions |
| **Fluorinated gases (HFCs, PFCs, SF₆)** | Extremely potent | Refrigeration, electronics, aerospace |
> **Why these gases?**
> They have molecular structures that allow them to absorb and re‑emit infrared (IR) radiation efficiently. When a gas molecule absorbs IR, it vibrates and then re‑radiates energy in all directions, including back toward the Earth’s surface.
---
## 2. How Does It Work? (Step‑by‑Step)
1. **Solar Radiation Reaches Earth**
- The Sun emits a spectrum of electromagnetic radiation, peaking in the visible range (~0.5 µm).
- About 30 % of this energy is reflected by clouds, ice, and the atmosphere (albedo).
- Roughly 70 % is absorbed by the surface (land, oceans, vegetation).
2. **Surface Heats Up**
- The absorbed solar energy raises the temperature of the Earth’s surface.
- A hot surface emits thermal radiation (infrared, ~10 µm).
3. **Infrared Radiation Interacts with Greenhouse Gases**
-<|channel|>analysis<|message|>Need concise description.<|end|><|start|>assistant<|channel|>final<|message|>**DNA (Deoxyribonucleic Acid)** is the hereditary material that carries the genetic instructions for the development, functioning, growth, and reproduction of all living organisms and many viruses. Its structure and function can be understood in two complementary ways: **molecular architecture** and **biological role**.
---
## 1. Molecular Structure
| Feature | Description | Biological Significance |
|---------|-------------|--------------------------|
| **Double‑Helix Backbone** | Two complementary strands wound around each other in a right‑handed helix. Each strand is a sugar‑phosphate chain (deoxyribose + phosphate). | Provides structural stability and protects the genetic code. |
| **Base Pairing** | Nucleotides on opposite strands pair via hydrogen bonds: Adenine (A) ↔ Thymine (T) (2 H‑bonds), Cytosine (C) ↔ Guanine (G) (3 H‑bonds). | Enables accurate replication and transcription; the complementary nature underlies the “copy‑and‑paste” mechanism of DNA. |
| **Nucleotide Composition** | Four bases: A, T, C, G. | Determines the sequence of genes and regulatory elements. |
| **Antiparallel Orientation** | One strand runs 5’→3’, the other 3’→5’. | Essential for polymerase enzymes to read and synthesize DNA in the correct direction. |
| **Major & Minor Grooves** | Surface features that allow protein binding. | Sites for transcription factors, polymerases, and other DNA‑binding proteins. |
| **Chromatin Packaging** | DNA wrapped around histone octamers → nucleosomes → higher‑order fibers → chromosomes. | Compact storage in the nucleus; regulates accessibility for transcription, replication, repair. |
---
## 2. Biological Functions
| Function | Mechanism | Key Players |
|----------|-----------|-------------|
| **Genetic Information Storage** | Sequence of bases encodes codons → amino acids → proteins. | Genes, regulatory sequences (promoters, enhancers). |
| **Replication** | Semi‑conservative duplication: each new duplex contains one parental strand. | DNA polymerases, helicases, primases, ligases. |
| **Transcription** | RNA polymerase reads one DNA strand → mRNA. | Promoters, transcription factors, RNA polymerase II (eukaryotes1@misc{priyanshu2025gptoss,
2 title={{GPT-OSS MoE Expert Fingerprinting: Analyzing Expert Activation Patterns in Mixture of Experts Models}},
3 author={Priyanshu, Aman and Vijay, Supriti},
4 year={2025},
5 howpublished={\url{https://amanpriyanshu.github.io/GPT-OSS-MoE-ExpertFingerprinting/}},
6 note={Interactive analysis tool for expert activation patterns in MoE architectures}
7}