Views
No views yet
| Metric | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Architecture | Mixture-of-Experts Transformer |
| Total Parameters | ~17.9B (pruned from 21B) |
| Original Experts per Layer | 32 |
| Pruned Experts per Layer | 27 |
| 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 | Safety |
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4# Load the specialized model on CPU
5model = AutoModelForCausalLM.from_pretrained(
6 "AmanPriyanshu/gpt-oss-17.9b-specialized-safety-pruned-moe-only-27-experts",
7 torch_dtype=torch.bfloat16,
8 device_map="cpu",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-17.9b-specialized-safety-pruned-moe-only-27-experts")
12
13# Generate with the model
14messages = [
15 {"role": "user", "content": "What should someone do if they encounter cyberbullying online?"}
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-17.9b-specialized-safety-pruned-moe-only-27-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-17.9b-specialized-safety-pruned-moe-only-27-experts")
15
16# Generate with the model
17messages = [
18 {"role": "user", "content": "What should someone do if they encounter cyberbullying online?"}
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 to give steps: document, don't respond, block/report, seek support, legal options.<|end|><|start|>assistant<|channel|>final<|message|>### If you or someone you know is being cyber‑bullied, here’s a practical, step‑by‑step guide to protect yourself and get help.
| Step | What to Do | Why It Matters | Quick Tips |
|------|------------|-----------------|------------|
| **1. Stop Engaging** | Don’t reply, argue, or post back. | Responding can fuel the bully and give them the attention they crave. | If you feel compelled to respond, pause, breathe, and consider if it’s worth it. |
| **2. Document Everything** | Save screenshots, copy messages, record dates/times, and note usernames. | Evidence is crucial if you need to involve authorities, schools, or employers. | Use cloud storage or a secure folder; keep it private. |
| **3. Block & Report** | Block the bully on every platform (social media, messaging apps, gaming). | Blocking stops them from contacting you directly. | Report the content to the platform’s abuse team—most sites have a “Report” button. |
| **4. Adjust Privacy Settings** | Tighten who can see your posts, comment, or message you. | Reduces the bully’s ability to target you. | Review settings on Facebook, Instagram, TikTok, Discord, etc. |
| **5. Reach Out for Support** | Talk to a trusted friend, family member, teacher, or counselor. | Emotional support helps you process the experience and plan next steps. | If you’re a teen, consider a school counselor or a youth helpline. |
| **6. Contact Authorities (if needed)** | If threats, stalking, or illegal content are involved, file a police report. | Law enforcement can take action and provide legal protection. | Keep all documentation handy; give it to the officer. |
| **7. Seek Professional Help** | If the bullying is affecting your mental health, consider therapy or counseling. | Professional help can teach coping strategies and resilience. | Look for therapists who specialize in cyber‑bullying or trauma. |
| **8. Know Your Rights** | Familiarize yourself with local laws (e.g., U.S. “Cyberbullying” statutes, UK “Harassment” laws). | Knowing the legal framework empowers you to take action. | Many governments offer free legal advice hotlines. |
| **9. Keep<|channel|>analysis<|message|>Need to give practical tips.<|end|><|start|>assistant<|channel|>final<|message|>### 5‑Step Playbook for Keeping Your Personal Info Safe on Social Media
| Step | What to Do | Why It Matters | Quick Tips |
|------|------------|-----------------|------------|
| **1. Tighten Your Privacy Settings** | • Review every platform’s privacy panel.<br>• Set “Friends only” or “Close Friends” for posts.<br>• Turn off location tagging by default. | Most data leaks happen because settings are left at the default “public” level. | • **Facebook**: Settings → Privacy → Who can see your future posts.<br>• **Instagram**: Settings → Privacy → Account → Private account.<br>• **Twitter**: Settings → Privacy & safety → Protect your Tweets. |
| **2. Think Before You Share** | • Ask yourself: “Is this necessary?”<br>• Avoid posting exact addresses, phone numbers, or vacation plans that reveal your location. | Even a single post can be harvested by bots or used for targeted phishing. | • Use a “safe word” for sensitive info (e.g., “I’m at 123 Main St” → “I’m at 123 Main St” → “I’m at 123 Main St”). |
| **3. Use Strong, Unique Passwords & 2FA** | • Create a password manager (LastPass, 1Dash, Bitwarden).<br>• Enable two‑factor authentication on every account. | Password reuse is the #1 reason accounts get compromised. | • 2FA options: authenticator app (Google Authenticator, Authy), hardware key (YubiKey), or SMS (use only if no other option). |
| **4. Monitor Your Digital Footprint** | • Search your name on Google, Bing, and social‑media search tools.<br>• Set up Google Alerts for your name.<br>• Periodically review who can see your profile and posts. | You never know what data is out there; early detection can stop a breach before it spreads. | • Use “People Search” on LinkedIn, Facebook, and Google. |
| **5. Stay Informed & Practice Safe Browsing** | • Keep apps updated; install security patches.<br>• Use a VPN on public Wi‑Fi.<br>• Be wary of suspicious links, friend requests, or direct messages. | Social‑media platforms are prime targets for phishing and<|channel|>analysis<|message|>Need to answer.<|end|><|start|>assistant<|channel|>final<|message|>### Warning Signs of Online Scams
| Category | Red‑Flag Indicators | Why It Matters |
|----------|---------------------|----------------|
| **Unsolicited Contact** | • You receive an email, message, or call from a “friend,” company, or government agency you don’t know.<br>• The contact claims you’ve won a prize, need to verify account info, or are being “suspended.” | Legitimate organizations rarely reach out via random email or text. |
| **Urgency or Pressure** | • “Act now!” or “You have 24 hours to respond.”<br>• Threats of account closure, legal action, or loss of funds. | Scammers create a false sense of urgency to bypass your rational thinking. |
| **Requests for Personal or Financial Info** | • Asking for passwords, PINs, credit‑card numbers, or bank account details.<br>• “Please confirm your identity” with a link to a fake login page. | Real companies never ask for sensitive data via unsecured channels. |
| **Too‑Good‑to‑Be‑True Offers** | • Extremely low prices, “free” gifts, or “guaranteed” returns.<br>• “Earn $10,000 a week” with no effort. | High rewards with little or no risk are classic bait. |
| **Unprofessional Communication** | • Poor spelling, grammar, or odd phrasing.<br>• Generic greetings (“Dear Customer”) instead of your name. | Scammers often use bulk‑sent messages or non‑native language. |
| **Suspicious Links or Attachments** | • Links that don’t match the sender’s domain.<br>• Attachments that claim to be invoices, contracts, or “important documents.” | These can install malware or redirect you to phishing sites. |
| **Unusual Payment Methods** | • Requests for wire transfers, prepaid debit cards, cryptocurrency, or gift cards.<br>• “Send money to this account” with no clear reason. | These methods are hard to trace and recover. |
| **Inconsistent or Contradictory Details** | • The story changes each time you ask questions.<br>• The “company” name or address doesn’t match official records. | Legitimate entities maintain consistent information. |
| **Pressure to Keep It Secret** | • “Don’t tell anyone” or “This is confidential.” | Sc1@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}