Views
No views yet
| Metric | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Architecture | Mixture-of-Experts Transformer |
| Total Parameters | ~9.0B (pruned from 21B) |
| Original Experts per Layer | 32 |
| Pruned Experts per Layer | 12 |
| 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 | All |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Load the specialized model on CPU
5model = AutoModelForCausalLM.from_pretrained(
6 "AmanPriyanshu/gpt-oss-9.0b-specialized-all-pruned-moe-only-12-experts",
7 torch_dtype=torch.bfloat16,
8 device_map="cpu",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-9.0b-specialized-all-pruned-moe-only-12-experts")
12
13# Generate with the model
14messages = [
15 {"role": "user", "content": "What is artificial intelligence and how does it work?"}
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-9.0b-specialized-all-pruned-moe-only-12-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-9.0b-specialized-all-pruned-moe-only-12-experts")
15
16# Generate with the model
17messages = [
18 {"role": "user", "content": "What is artificial intelligence and how does it work?"}
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 explain AI concept, types, how works.<|end|><|start|>assistant<|channel|>final<|message|>## 1. What is Artificial Intelligence?
Artificial Intelligence (AI) is a set of computational techniques that let machines “think” and “act” in ways that resemble human cognition. In short, AI is a **software system that can learn, reason, and make decisions** without a human brain.
| **Key Features** | **What Makes It “Artificial”** | **What Makes It “Intelligent”** |
|-------------------|---------------------------|---------------------------|
| **Learning** | Learges from data it has seen | Learges from patterns, not from a pre‑built rule set |
| **Reasoning** | Uses logic, inference, and prediction | Can generate new solutions to problems |
| **Generalization** | Works on a wide range of tasks | Adises to new contexts |
| **Autonomy** | Can act without explicit human control | Makes decisions that are useful or optimal |
AI is not a single technology; it is a **family of methods** that can be combined to build a system that can:
* **Recognize** patterns in images, text, or sound (image, speech, text recognition)
* **Predict** future events from past data (forecasting, recommendation)
* **Generate** new content (writing, music, art)
* **Plan** and **solve** problems (planning, optimization, game‑playing)
---
## 2. How AI Works – The Core Ingredients
### 2.1 Data
AI starts with a **dataset** – a collection of facts, images, or text. The data can be:
* **Structured** (labels, categories) – e.g., a labeled dataset of “cat” vs “dog” images.
* **Unstructured** (raw, noisy) – e.g., millions of tweets with no labels.
### 2.2 Representation
The data is turned into a **machine‑readable format**:
* **Text → Tokens** (words, characters)
* **Images → Pixels + Features** (color, shape, texture)
* **Audio → Frequencies** (pitch, timo)
### 2.3 Training
The system learns by **exposing it to the data** and letting it **try** to answer a question. The learning process is usually:
| **Method** | **What Happens** | **Why It Works** |
|------------|-----------------|-----------------|
| **Revised<|channel|>analysis<|message|>Need simple explanation.<|end|><|start|>assistant<|channel|>final<|message|>**Einstein’s Theory of Relativity – in plain words**
---
### 1. What the idea is
Einstein’s theory says that **the way we measure distances, time, and mass changes when objects move very fast or very far from each other**. In everyday physics we treat objects as if they are “fixed” in space, but when they are moving, especially over huge distances, that’s not true.
---
### 2. The two main ideas
| Concept | What we normally think | What Einstein says |
|--------|------------------------|------------------------|
| **Time** | “Time is the same everywhere.” | Time *depends* on the motion of an object. If something moves, the time it takes to travel changes. |
| **Mass** | “Mass is a fixed property of an object.” | Mass *depends* on the motion of an object. An object can appear heavier or lighter depending on where it is. |
---
### 3. How it works – the “clock” example
1. **Two clocks on a moving spaceship**
- Clock A is on the spaceship.
- Clock B is on a planet far away.
2. **If the spaceship is moving toward the planet**
- Clock A’s time ticks *slier* than Clock B’s time.
- The difference in the time between the two clocks is exactly the *speed* of the spaceship.
3. **If the spaceship is moving away from the planet**
- Clock A’s time ticks *fier* than Clock B’s time.
- The difference is again the speed, but now in the opposite direction.
So the *time difference* between two clocks tells us how fast the spaceship is moving. That’s the “time moves with the object” part.
---
### 4. Mass changes the same way
If we look at a *mass* (like a ball) on the spaceship:
- While the spaceship is moving toward the planet, the ball’s mass appears *smaller* than it would be on the planet.
- While the spaceship is moving away, the ball’s mass appears *larger*.
The change in mass is exactly the same as the change in time. That’s the “mass changes with the object” part.
---
### 5. Why it matters
- **Gravity**: The theory explains why a ball feels heavier when it<|channel|>analysis<|message|>Need explain concept, institutions, checks, participation, representation, accountability, checks of power, etc.<|end|><|start|>assistant<|channel|>final<|message|>### 1. What is “democracy” in today’s world?
In the 21‑st‑century, democracy is usually understood as a **system of government in which the people have the ultimate authority** over the state’s policies, laws, and leaders. The core ideas are:
| Feature | How it works in practice |
|--------|------------------------|
| **Representative** | Citizens elect elected officials (parliament, council, etc.) who act on the public’s will. |
| **Participative** | Citizens can influence policy through voting, petitions, public debate, protests, and civic engagement. |
| **Accountable** | Leaders are answerable to the public, through elections, oversight bodies, and the media. |
| **Rule‑of‑law** | Laws are made, interpreted, and enforced by independent institutions (cour courts, judiciary). |
| **Checks of power** | Separation of branches (executive, legislative, judiciary) and checks (epar, oversight, civil‑rights). |
### 2. How democracy shows itself in modern governments
| Institutional | What does it do? | Typical examples |
|----------------|----------------|----------------|
| **Parleg‑/Council** | Elects leaders, drafts laws, debates policy. | Parliament (UK, Australia), Senate (US), Legislative Assembly (India). |
| **Executive** | Implements policy, runs day‑of‑the‑state. | President/Prime‑Minister, Cabinet. |
| **Judiciary** | Interinterpres law, protects rights. | Courts, Supreme Court, Constitutional Review Board. |
| **Civil‑Rights Bodies** | Protect minority rights, ensure fairness. | Human‑Rights Commission, Ombudsman. |
| **Media & NGOs** | Inform the public, hold leaders in check. | Newspapers, watchdog groups. |
| **E‑polling & Digital Platforms** | Facilitate voting, debate, data‑analysis. | Online voting pilots, social‑media campaigns. |
### 3. The “checks” that keep democracy alive
1. **Separation of branches** – The executive, legislative, and judiciary are independent.
2. **Checks & balances** – Overswatch committees, parliamentary oversight, judicial review.
3. **Transparency** – Open‑data portals, public‑record of‑decations,1@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}