Views
No views yet
| Metric | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Architecture | Mixture-of-Experts Transformer |
| Total Parameters | ~19.1B (pruned from 21B) |
| Original Experts per Layer | 32 |
| Pruned Experts per Layer | 29 |
| 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-19.1b-specialized-science-pruned-moe-only-29-experts",
7 torch_dtype=torch.bfloat16,
8 device_map="cpu",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-19.1b-specialized-science-pruned-moe-only-29-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-19.1b-specialized-science-pruned-moe-only-29-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-19.1b-specialized-science-pruned-moe-only-29-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 to explain photosynthesis.<|end|><|start|>assistant<|channel|>final<|message|>**Photosynthesis** is the process by which green plants, algae, and some bacteria convert light energy from the sun into chemical energy stored in organic molecules (mainly sugars). It occurs mainly in the chloroplasts of plant cells, specifically within the thylakoid membranes. The overall reaction can be summarized as:
\[
6\,\text{CO}_2 + 6\,\text{H}_2\text{O} + \text{light energy} \;\longrightarrow\; C_6H_{12}O_6 + 6\,\text{O}_2
\]
Below is a step‑by‑step breakdown of the process, highlighting the two main stages: the **light‑dependent reactions** (also called the *photochemical* or *Z-scheme* reactions) and the **light‑independent reactions** (the *Calvin–Benson cycle*).
---
## 1. Light‑Dependent Reactions (Z‑scheme)
| Step | What Happens | Key Components | Outcome |
|------|--------------|----------------|---------|
| **1. Photon absorption** | Light hits chlorophyll‑a (and accessory pigments) in the reaction center of Photosystem II (PSII). | PSII, chlorophyll‑a, carotenoids | Excitation of an electron to a high energy state. |
| **2. Water splitting (photolysis)** | The excited electron is replaced by an electron from water. Water is oxidized to O₂, H⁺, and electrons. | Water‑oxidizing complex (Mn‑cluster) | Release of O₂ (byproduct) and protons (H⁺) into the thylakoid lumen. |
| **3. Electron transport chain (ETC)** | The high‑energy electron travels through a series of carriers: plastoquinone (PQ), cytochrome b₆f, plastocyanin, and finally Photosystem I (PSI). | PQ, cytochrome b₆f, plastocyanin, PSI | Generates a proton gradient across the thylakoid membrane. |
| **4. ATP synthesis** | Protons flow back into the stroma through ATP synthase, driving phosphorylation of ADP to ATP. | ATP synthase, proton gradient | Production of ATP (energy currency). |
| **5. NADPH formation** | The electron reaches PSI<|channel|>analysis<|message|>Need explain greenhouse effect causes, mechanism, greenhouse gases, absorption, re-emission, etc.<|end|><|start|>assistant<|channel|>final<|message|>### The Greenhouse Effect – What It Is and How It Works
| **Step** | **What Happens** | **Why It Matters** |
|----------|------------------|--------------------|
| 1. Solar radiation reaches Earth | Sun emits a spectrum of electromagnetic waves, mainly visible light and a bit of infrared (IR). | These waves are the primary energy source for Earth’s climate. |
| 2. Surface absorbs and warms | The Earth’s surface (land, oceans, ice) absorbs most of the incoming solar energy and heats up. | Warm surface is the starting point for the whole energy cycle. |
| 3. Surface re‑radiates energy | The warmed surface emits energy back into space, but this time it is mostly in the long‑wave (infrared) part of the spectrum. | Infrared radiation is the key to the greenhouse effect because it is the wavelength that greenhouse gases interact with. |
| 4. Greenhouse gases absorb IR | Gases such as CO₂, CH₄, H₂O vapor, N₂O, and others have molecular vibrations that resonate with IR wavelengths. They absorb some of the outgoing IR. | Absorption raises the energy (temperature) of the gas molecules. |
| 5. Gases re‑emit IR in all directions | After absorbing, the gases re‑emit IR radiation isotropically (in all directions). | A fraction of this re‑emitted IR goes back toward the surface (downward flux), while the rest escapes to space. |
| 6. Net downward IR warms the surface | The downward IR from greenhouse gases adds to the surface’s energy budget, keeping the surface warmer than it would be if all IR escaped directly to space. | This extra warming is the “greenhouse effect.” |
---
## 1. What Causes the Greenhouse Effect?
| **Natural** | **Anthropogenic (Human‑Made)** |
|-------------|------------------------------|
| **Water vapor** – the most abundant greenhouse gas, produced by evaporation. | **Carbon dioxide (CO₂)** – from burning fossil fuels, deforestation, cement production. |
| **Methane (CH₄)** – from wetlands, ruminants, rice paddies, landfills. | **Methane (CH₄)** – from agriculture, natural gas extraction, waste. |
| **Nitrous<|channel|>analysis<|message|>Need concise description.<|end|><|start|>assistant<|channel|>final<|message|>**DNA (Deoxyribonucleic Acid)** is the hereditary material that carries the genetic instructions used in the growth, development, functioning, and reproduction of all known living organisms and many viruses. Its structure and function can be understood in two complementary parts: the physical architecture of the molecule and the biological roles it performs.
---
## 1. Structural Overview
| Feature | Description | Key Details |
|---------|-------------|-------------|
| **Polymers of Nucleotides** | DNA is a polymer composed of repeating units called nucleotides. | Each nucleotide contains a phosphate group, a deoxyribose sugar, and one of four nitrogenous bases. |
| **Nitrogenous Bases** | Four bases: Adenine (A), Thymine (T), Cytosine (C), Guanine (G). | A pairs with T via two hydrogen bonds; C pairs with G via three hydrogen bonds. |
| **Backbone** | The sugar‑phosphate backbone runs along the outside of the double helix. | Phosphodiester bonds link the 3′‑OH of one sugar to the 5′‑phosphate of the next. |
| **Double‑Helix** | Two complementary strands wind around each other. | Right‑handed helix, ~10.5 base pairs per turn, ~3.4 nm pitch. |
| **Antiparallel Orientation** | Strands run in opposite directions (5′→3′ vs 3′→5′). | Essential for base‑pairing and enzymatic processes. |
| **Major & Minor Grooves** | Surface features that allow protein binding. | Major groove ~12 Å wide, minor groove ~8 Å wide. |
| **Chromatin Packaging** | In eukaryotes, DNA wraps around histone proteins to form nucleosomes. | Higher‑order folding leads to chromosomes. |
| **Topological Features** | Supercoiling, knots, and loops influence replication and transcription. | Topoisomerases manage DNA topology. |
---
## 2. Functional Roles
| Function | How DNA Performs It | Biological Significance |
|----------|---------------------|------------------------|
| **Genetic Information Storage** | Sequence of bases encodes genes and regulatory elements. | Determines phenotype, cellular function, and inheritance. |
| **Replication** | Semi‑conservative duplication via DNA polymerases. | Enables1@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}