Views
No views yet
| Metric | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Architecture | Mixture-of-Experts Transformer |
| Total Parameters | ~13.7B (pruned from 21B) |
| Original Experts per Layer | 32 |
| Pruned Experts per Layer | 20 |
| 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-13.7b-specialized-law-pruned-moe-only-20-experts",
7 torch_dtype=torch.bfloat16,
8 device_map="cpu",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-13.7b-specialized-law-pruned-moe-only-20-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-13.7b-specialized-law-pruned-moe-only-20-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-13.7b-specialized-law-pruned-moe-only-20-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 explain difference.<|end|><|start|>assistant<|channel|>final<|message|>**Civil law** and **criminal law** are the two main branches of the legal system that deal with very different kinds of disputes and wrongs. While they share some procedural tools (e.g., courts, judges, evidence rules), their purposes, parties, burdens of proof, and consequences are distinct.
| Feature | Civil Law | Criminal Law |
|---|---|---|
| **Purpose** | Resolve disputes between private parties (individuals, businesses, or organizations). | Protect society and maintain public order by punishing conduct that is deemed harmful or dangerous. |
| **Parties** | Plaintiff (the person or entity that claims harm) vs. Defendant (the person or entity accused of wrongdoing). | State (or government) vs. Defendant (the person accused of a crime). |
| **Nature of Wrong** | Wrongful acts that cause injury, loss, or breach of contract. | Acts that violate statutes or criminal codes (e.g., theft, assault, murder). |
| **Burden of Proof** | **Pre‑ponderance of evidence** – “more likely than not.” | **Beyond a reasonable doubt** – the highest standard. |
| **Remedies** | Usually **compensation** (damages) or **specific performance** (e.g., injunction, contract enforcement). | **Punitive** (penalties such as fines, imprisonment, probation) and sometimes restitution. |
| **Procedures** | Often **civil litigation**: pleadings, discovery, trial, settlement. | **Criminal proceeding**: arraignment, plea, trial, sentencing. |
| **Rights of the Defendant** | Right to a fair trial, but no right to a jury in all jurisdictions (though many have jury trials). | Strong constitutional protections: right to counsel, right against self‑incrimination, right to a jury, right to a speedy trial. |
| **Outcome** | The court orders the defendant to pay damages, perform an act, or refrain from an act. | The court imposes a penalty (fine, imprisonment, community service, etc.). |
| **Appeals** | Usually to a higher civil court; the standard of review is often “deference to the trial court’s findings.” | Appeals are often to a higher criminal court; the appellate court reviews for legal errors, not factual findings. |
### Key Differences in Practice
1. **Who Initiates the Action?**
- *Civil<|channel|>analysis<|message|>Need explain due process.<|end|><|start|>assistant<|channel|>final<|message|>**Due Process (or “Due Process”) – A Cornerstone of Fair Justice**
---
### 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 any action that could affect that person’s liberty, property, or other legal interests. It is the procedural counterpart to substantive rights (e.g., the right to life, property, or freedom from discrimination). In short, *due process* guarantees that the government follows a fair, transparent, and predictable set of steps before making a decision that matters to you.
---
### 2. Core Elements
| Element | Meaning | Typical Example |
|---------|----------|----------------|
| **Notice** | The individual must be informed of the action, the allegations, and the consequences. | A summons to a criminal trial, a notice of eviction. |
| **Opportunity to Respond** | The person must be given a chance to present evidence, argue, and cross‑examine witnesses. | A hearing before a judge, a trial. |
| **Neutral Decision‑Maker** | The decision must be made by an impartial judge, jury, or administrative body. | A judge in a civil case, a jury in a criminal case. |
| **Right to Counsel** | The individual may have legal representation, especially in serious matters. | Defense counsel in criminal proceedings. |
| **Rule of Law** | The process must follow established statutes, regulations, and precedent. | Statutory criminal code, administrative regulations. |
| **Procedural Consistency** | Similar cases are treated similarly; the process is not arbitrary. | Equal treatment of all defendants in a criminal case. |
| **Judicial Review** | The decision can be challenged in a higher court. | Appeal of a conviction. |
---
### 3. Why It Matters
1. **Prevention of Arbitrary Power** – Without due process, governments could act capably and unpredictably, undermining liberty and property rights.
2. **Transparency & Accountability** – The public can see how decisions are made, fostering trust in the legal system.
3. **Error Correction** – Mistakes can be identified and rectified through appeals or reviews.
4. **Fairness & Equality** – All individuals receive the same procedural protections, regardless of status.
---
### 4. How It Appears in Different Legal Systems
| System | Key Features of<|channel|>analysis<|message|>Need to answer: 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 that are considered essential to a free and democratic society. These rights are:
| **Right** | **Description** | **Key Points** |
|-----------|----------------|--------------|
| **Freedom of Religion** | Individuals may practice any religion, or none, without government interference. | Includes both the *establishment clause* (no state religion) and the *free‑exercise clause* (no undue restrictions on religious practice). |
| **Freedom of Speech** | Citizens can express ideas, opinions, and information without censorship. | Includes political speech, symbolic actions, and, in most cases, the right to criticize the government. |
| **Freedom of the Press** | Media outlets can publish news, opinions, and investigative reporting. | Protects the press from prior restraint and government control over content. |
| **Right to Assemble** | People may gather peacefully for protests, rallies, or other collective activities. | Includes the right to form and join associations, unions, or political parties. |
| **Right to Petition the Government** | Citizens can request changes to laws or policies and seek redress from the government. | Covers petitions, lobbying, and other forms of direct communication with officials. |
These five freedoms together form the foundation 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}