Views
No views yet
| Metric | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Architecture | Mixture-of-Experts Transformer |
| Total Parameters | ~16.7B (pruned from 21B) |
| Original Experts per Layer | 32 |
| Pruned Experts per Layer | 25 |
| 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-16.7b-specialized-all-pruned-moe-only-25-experts",
7 torch_dtype=torch.bfloat16,
8 device_map="cpu",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-16.7b-specialized-all-pruned-moe-only-25-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-16.7b-specialized-all-pruned-moe-only-25-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-16.7b-specialized-all-pruned-moe-only-25-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, types, how works.<|end|><|start|>assistant<|channel|>final<|message|>## What is Artificial Intelligence?
Artificial Intelligence (AI) is the field of computer science that seeks to build systems capable of performing tasks that normally require human intelligence. These tasks include:
| Task | Typical Human Skill | AI Approach |
|------|---------------------|-------------|
| Recognizing faces | Visual perception | Computer vision, deep learning |
| Understanding language | Natural language comprehension | Natural‑language processing (NLP) |
| Playing chess | Strategic planning | Search algorithms, reinforcement learning |
| Driving a car | Perception + decision making | Sensor fusion + control systems |
| Diagnosing disease | Pattern recognition + medical knowledge | Machine learning + knowledge bases |
In short, **AI is about giving machines the ability to learn from data, reason about the world, and act autonomously or semi‑autonomously.**
---
## How AI Works – The Core Ingredients
| Component | What it does | Typical Techniques |
|-----------|--------------|--------------------|
| **Data** | The raw material from which models learn | Images, text, sensor streams, logs |
| **Representation** | How we encode knowledge | Feature vectors, embeddings, symbolic rules |
| **Learning** | Adjusting a model to fit data | Supervised, unsupervised, reinforcement learning |
| **Inference** | Using the model to make predictions or decisions | Forward/backward propagation, Monte‑Carlo search |
| **Actuation** | Executing actions in the real world | Robotics, API calls, recommendation engines |
| **Feedback** | Updating the system based on outcomes | Online learning, human‑in‑the‑loop |
Below is a step‑by‑step view of a typical AI pipeline:
1. **Collect Data**
*Example:* A self‑driving car collects LiDAR, camera, GPS, and IMU data.
2. **Pre‑process & Feature‑Engineer**
*Example:* Convert raw sensor streams into a set of numerical features (e.g., distance to nearest obstacle).
3. **Choose a Model**
*Example:* A convolutional neural network (CNN) for image classification, a recurrent neural network (RNN) for time‑series, or a transformer for language.
4. **Train the Model**
*Example:* Use stochastic gradient descent to minimize a loss function (e.g., cross‑entropy for classification).
5. **Validate & Test**
*Example:* Evaluate on<|channel|>analysis<|message|>Need simple explanation.<|end|><|start|>assistant<|channel|>final<|message|>**Einstein’s Theory of Relativity – in plain, everyday language**
---
### 1. Two main ideas
| **Special Relativity** | **General Relativity** |
|------------------------|------------------------|
| Deals with objects moving at constant speeds (especially near the speed of light). | Deals with gravity and how it bends space and time. |
---
### 2. Special Relativity (1905)
1. **Speed of light is the same for everyone**
- No matter how fast you’re moving, light always travels at the same speed (≈ 300 000 km/s).
- This is like a “speed limit” that can’t be broken.
2. **Time and space are not absolute**
- If you’re moving fast, time for you ticks slower compared to someone standing still.
- Lengths shrink in the direction of motion.
- Think of a moving train: a clock on the train runs slower, and a ruler on the train looks a bit shorter to an outside observer.
3. **Mass and energy are interchangeable**
- The famous equation \(E = mc^2\) says that a tiny amount of mass can be converted into a huge amount of energy (because \(c^2\) is enormous).
**Why it matters:**
- Explains why GPS satellites need tiny corrections.
- Explains why particles in accelerators can reach enormous energies.
- Gives the foundation for modern physics (quantum field theory, etc.).
---
### 3. General Relativity (1915)
1. **Gravity is not a “force” but a curvature of space‑time**
- Imagine a heavy ball on a rubber sheet. The sheet sags around the ball.
- Smaller balls rolling nearby follow curved paths because the sheet is bent.
- In the universe, massive objects (planets, stars, black holes) bend the “fabric” of space‑time, and other objects move along those curves.
2. **Time runs slower where gravity is stronger**
- Near a massive planet, clocks tick a little slower than clocks far away.
- This is why GPS satellites (far from Earth’s gravity) run a tiny bit faster than clocks on the ground.
3. **Light follows the curves**
- Light rays bend around massive objects.
- This is why stars appear slightly shifted when their<|channel|>analysis<|message|>Need to explain democratic functioning.<|end|><|start|>assistant<|channel|>final<|message|>**Democracy in Modern Governments: How It Functions Today**
Modern democracies are built on a set of shared principles—rule of law, political pluralism, and the protection of individual rights—but the exact mechanisms that bring those principles to life vary widely from country to country. Below is a concise, step‑by‑step overview of the key components that make a contemporary democratic system work, followed by a quick comparison of the most common models.
---
## 1. The Core Pillars
| Pillar | What It Means | Typical Institutional Forms |
|--------|---------------|------------------------------|
| **Popular Sovereignty** | The people are the ultimate source of political authority. | Universal, free, and secret elections; referenda; citizen‑initiated legislation. |
| **Rule of Law** | All actions by the state are bound by law, and laws are applied equally. | Independent judiciary; constitutional courts; legal codes that protect rights. |
| **Political Pluralism** | Multiple parties and viewpoints can compete for power. | Multi‑party systems; proportional or mixed electoral systems; campaign finance regulations. |
| **Civil Liberties & Human Rights** | Freedom of expression, assembly, religion, and privacy. | Constitutional guarantees; ombudsman offices; human‑rights commissions. |
| **Accountability & Transparency** | Public officials must explain and justify their actions. | Freedom‑of‑information laws; open‑budget systems; anti‑corruption agencies. |
---
## 2. The Everyday Mechanics
| Mechanism | How It Works | Typical Examples |
|-----------|--------------|------------------|
| **Elections** | Citizens vote for representatives or directly for policy. | Presidential, parliamentary, or local elections; proportional representation; ranked‑choice voting. |
| **Legislative Process** | Laws are drafted, debated, amended, and passed by elected bodies. | Bicameral parliaments; committee hearings; public consultations. |
| **Executive Function** | The elected head of state (president, prime minister) implements laws. | Cabinet appointments; executive orders; policy agendas. |
| **Judicial Review** | Courts interpret laws and can strike down unconstitutional acts. | Constitutional courts; appellate courts; judicial oversight of administrative actions. |
| **Civil Society & Media** | NGOs, unions, and the press hold the government accountable. | Freedom of the press; watchdog NGOs; public protests. |
| **Checks &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}