Views
No views yet
| Metric | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Architecture | Mixture-of-Experts Transformer |
| Total Parameters | ~15.5B (pruned from 21B) |
| Original Experts per Layer | 32 |
| Pruned Experts per Layer | 23 |
| 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 | Law |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Load the specialized model on CPU
5model = AutoModelForCausalLM.from_pretrained(
6 "AmanPriyanshu/gpt-oss-15.5b-specialized-law-pruned-moe-only-23-experts",
7 torch_dtype=torch.bfloat16,
8 device_map="cpu",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-15.5b-specialized-law-pruned-moe-only-23-experts")
12
13# Generate with the model
14messages = [
15 {"role": "user", "content": "What is the difference between civil and criminal law?"}
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-15.5b-specialized-law-pruned-moe-only-23-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-15.5b-specialized-law-pruned-moe-only-23-experts")
15
16# Generate with the model
17messages = [
18 {"role": "user", "content": "What is the difference between civil and criminal law?"}
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|>**Civil law** and **criminal law** are the two main branches of the legal system, and they differ in purpose, parties involved, burden of proof, and remedies.
| Feature | Civil Law | Criminal Law |
|---------|-----------|--------------|
| **Purpose** | Resolve disputes between private parties (individuals, businesses, organizations). | Protect society by punishing conduct that violates public law. |
| **Parties** | Plaintiff (the party bringing the claim) vs. Defendant (the party being sued). | State or government (prosecution) vs. Defendant (the accused). |
| **Burden of Proof** | “Pre‑ponderance of evidence” – more likely than not. | “Beyond a reasonable doubt” – very high standard. |
| **Remedies** | Usually monetary damages, injunctions, or specific performance. | Penalties such as fines, imprisonment, probation, or community service. |
| **Nature of Wrong** | Wrongful acts that cause harm or loss (e.g., breach of contract, negligence). | Acts that are considered crimes (e.g., theft, assault, murder). |
| **Procedure** | Civil courts (or arbitration/mediation) handle the case; parties often represent themselves or hire counsel. | Criminal courts (trial courts, sometimes special criminal courts) handle the case; the state prosecutes, and the defendant is represented by counsel (often a public defender if indigent). |
| **Outcome** | The defendant may be ordered to pay damages or perform some action. | The defendant may be found guilty and sentenced, or acquitted. |
| **Appeals** | Parties can appeal civil judgments. | Both the prosecution and the defendant can appeal criminal convictions or sentences. |
In short: **Civil law** is about disputes between private parties and usually ends with compensation or an order to act; **criminal law** is about offenses against society and ends with punishment or correction.<|return|><|channel|>analysis<|message|>Need explain due process.<|end|><|start|>assistant<|channel|>final<|message|>**Due Process (or Due Process) – A Fundamental Legal Principle**
---
### 1. What is Due Process?
**Due process** is the set of legal safeguards that ensure a person’s rights are respected before the state takes actions that could affect their liberty, property, or other legal interests. It is the procedural counterpart to the substantive rights protected by a constitution or law. In short, *due process guarantees that the government follows fair, transparent, and consistent procedures before depriving someone of a protected interest.*
---
### 2. Core Elements
| Element | Meaning | Typical Example |
|---------|----------|----------------|
| **Notice** | The person must be informed of the action, the allegations, and the time/place to respond. | A summons to a civil lawsuit. |
| **Opportunity to be Heard** | The person must have a chance to present evidence, cross‑examine witnesses, and argue their case. | A trial, a hearing before an administrative agency. |
| **Neutral Decision‑Maker** | The decision must be made by an impartial judge, jury, or official. | A judge in a criminal trial. |
| **Reasoned Decision** | The decision must be based on evidence and legal reasoning, not arbitrary whim. | A written judgment explaining the basis for a conviction. |
| **Right to Appeal** | The person can challenge the decision in a higher court or body. | Appeal to a appellate court after a trial verdict. |
| **Equal Treatment** | The same rules apply to all similarly situated persons. | No discrimination in how evidence is weighed. |
---
### 3. Why It Matters
| Context | Why Due Process is Essential |
|---------|------------------------------|
| **Criminal Law** | Protects against arbitrary imprisonment, ensures guilt is proven beyond a reasonable doubt. |
| **Civil Law** | Guarantees fair resolution of disputes over contracts, property, family matters. |
| **Administrative Law** | Prevents unfair denial of benefits, licenses, or permits. |
| **Human Rights** | International instruments (e.g., ICCPR, ICCPR) require due process as a minimum standard. |
---
### 4. Variations Across Legal Systems
| System | Typical Due Process Features |
|--------|------------------------------|
| **Common Law (e.g., U.S., U.K.)** | Adversarial system, trial by judge/jury, strong emphasis on procedural rules. |
|<|channel|>analysis<|message|>Need to answer: rights: freedom of religion, speech, press, assembly, petition.<|end|><|start|>assistant<|channel|>final<|message|>The First Amendment to the United States Constitution protects several core civil liberties. In plain terms, it guarantees:
| Right | What it means |
|--------|---------------|
| **Freedom of religion** | The right to practice any religion (or none) without government interference, and the prohibition on the government establishing a state religion. |
| **Freedom of speech** | The right to express ideas, opinions, and information without censorship or punishment by the government. |
| **Freedom of the press** | The right for newspapers, books, radio, television, and other media to publish and broadcast content without government control. |
| **Freedom of assembly** | The right to gather peacefully—whether for protests, rallies, or other meetings—without government restriction. |
| **Freedom to petition the government** | The right to appeal to the government for redress of grievances, including the right to file complaints, petitions, or lawsuits. |
These five freedoms together form the core of the First Amendment’s protection of individual liberty and democratic participation.<|return|>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}