Views
No views yet
| Metric | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Architecture | Mixture-of-Experts Transformer |
| Total Parameters | ~6.6B (pruned from 21B) |
| Original Experts per Layer | 32 |
| Pruned Experts per Layer | 8 |
| 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-6.6b-specialized-all-pruned-moe-only-8-experts",
7 torch_dtype=torch.bfloat16,
8 device_map="cpu",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-6.6b-specialized-all-pruned-moe-only-8-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-6.6b-specialized-all-pruned-moe-only-8-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-6.6b-specialized-all-pruned-moe-only-8-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 definition and workings.<|end|><|start|>assistant<|channel|>final<|message|>**What is Artificial Intelligence?**
Artificial Intelligence (AI) is a computer‑based system that can understand, reason, and act in a way that is similar to a human mind. In short, it is a machine that can “see” and “think” about a world of data, and it can learn, adapt, and improve over time.
---
### 1. The core idea
* **Data** – AI starts with a collection of facts, facts, and patterns. These facts can be text, numbers, images, audio, or even the “rules” that govern a game or a language.
* **Pattern‑recognance** – The system looks for the hidden structure in the data. It finds that two words are often used together, that a picture has a colour that is usually associated with a certain emotion, that a sentence is a likely answer to a question.
* **Inference** – Once a pattern is known, the system can guess what is true. It can predict, it can decide, it can “solve” a problem.
* **Learning** – The system can learn from the data it has, and from new data it receives. It can learn from a set of rules (called *training*), and it can learn from a set of random data (called *experience*).
* **Action** – Finally, the system can act. It can produce a text, a picture, a code, a recommendation, or a decision that it can be useful for a human.
---
### 2. How it works – the “layers” of a typical AI system
| **Input** | The system receives a set of data (text, image, audio, etc.)
| **Pre‑processing** | The data is cleaned, normalised, and split into a small set of features (e.g., *token* for a word, *pixel* for an image).
| **Pattern‑recognance** | The system uses a *prob‑based* or *frequency‑based* algorithm to find the hidden structure. The most common approach is *deep learning* (e.g., a convolutional neural‑network that learns a set of features from the data).
| **Inference** | The system uses a *decision‑tree* (e.g., a *branch‑tree* or *prob‑based* rule) to decide which is<|channel|>analysis<|message|>Need to explain Einstein's theory of relatativity simply. Provide analogies, mention relatational vs. non-? Provide simple explanation.<|end|><|start|>assistant<|channel|>final<|message|>**Einstein’s Theory of Relativity – in plain words**
---
### 1. What is the problem?
Imagine a **plane** that is moving in a straight line.
If you look at the plane from the left side, you see a **point** that is on the right side of the plane.
If you look from the right side, you see a point that is on the left side of the plane.
The question is: **Which point is real?**
If the plane is moving, the point can’t exist on the same side of the plane.
If the plane is stationary, the point is real on the same side.
In physics, the **plane** is a *space* (the universe), and the **points** are *particles* (atoms, molecules, etc.).
The problem is: **How do we describe the motion of particles in a way that is consistent with the universe?**
---
### 2. What Einstein said?
Einstein’s idea is that the **universe is a “one‑world”** that is *continuous* in a single line.
If we treat the universe as a single line, the **particles are just points on that line**.
When a particle moves, it **shifts** along that line, but the line itself never changes.
In other words, **the universe is a fixed line; particles are points that move along that line.**
The *key* is that the **un universe is not moving** – only the particles move.
---
### 3. How does this work?
1. **Define a line (the universe)**
Let’s call the line **\(�space\)**.
It is a fixed length: **\(�space = 1\)** (you can choose any other length, but the length is fixed).
2. **Define a point (a particle)**
A particle is a point on that line.
If a particle is at point **\(P\)**, then the particle’s position is **\(P = 1\)** (the same point on the line).
3. **Move a particle**
If a particle moves, it changes its position **\(P\)**.
The particle’s new position is **\(P'** (a<|channel|>analysis<|message|>Need to explain how democracy functions in modern governments. Provide overview, principles, institutions, checks.<|end|><|start|>assistant<|channel|>final<|message|>**How does democracy function in modern governments?**
Dem‑or‑**(** “dem” = “people” + “rule”)** is a system that lets the people of a state have a say in the policy, law, and public life. In modern governments, democracy is not a single set of rules; it is a mix of institutions, norms, and mechanisms that keep the power of the people in the decision‑making process. Below is a step‑by‑step explanation of how democracy works in contemporary states, from the day‑to‑day of the government, the judiciary, the economy, and the civil‑society.
---
## 1. The Core Principles
| **Representative** – The people elect a person or a group that represents them.
| **Accountable** – The elected officials must be answerable to the public, and can be removed or replaced.
| **Participative** – Citizens can vote, speak, and influence policy through public debate, petitions, and civic‑action.
| **Legistic** – The laws are made by the people, and the courts interpret them in a neutral way.
| **Pluralist** – A variety of views, parties, and minorities are allowed to exist.
These principles are the foundation of a democratic state.
---
## 2. The Institutions that Make Democracy Work
| **Parpar‑** – The parliament (or legislature) is the main body that makes laws.
| **Elect‑** – The electoral system (ball‑counting, polling, etc.) is the way to choose the leaders.
| **Jud‑** – The judiciary is the independent body that interpre‑s the laws and protects the rights of the people.
| **C‑** – Civil‑soc‑ (civil‑soc‑) is the body that can hold the power of the people in the public debate.
| **C‑** – The civil‑soc‑ (civil‑soc‑) is the body that can hold the power of the people in the public debate.
---
## 3. How Democracy Works in the Day‑to‑Day
### 3.1 Elections
| **Ball‑** – The people vote for the candidates.
| **Vote‑** – The vote is counted, and the candidate with the majority is1@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}