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 | Safety |
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-safety-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-safety-pruned-moe-only-25-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-16.7b-specialized-safety-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-safety-pruned-moe-only-25-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 advice.<|end|><|start|>assistant<|channel|>final<|message|>**If you or someone you know is being cyber‑bullied, here are practical steps you can take right away:**
| Step | What to Do | Why It Helps |
|------|------------|--------------|
| **1. Don’t Respond** | Ignore or delete the bully’s messages. | Responding can fuel the conflict and give the bully the reaction they’re looking for. |
| **2. Save Evidence** | Take screenshots, copy links, and keep any emails or messages. | Evidence is essential if you need to report the abuse to a platform, school, or law‑enforcement. |
| **3. Block/Unfriend** | Use the platform’s block, mute, or remove options. | Removes the bully’s ability to contact you and limits their reach. |
| **4. Report the Abuse** | Use the “Report” button on the platform (Facebook, Instagram, TikTok, etc.). | Platforms have policies against harassment and can remove content or suspend accounts. |
| **5. Adjust Privacy Settings** | Tighten who can see your posts, who can comment, and who can message you. | Reduces the bully’s ability to target you. |
| **6. Tell a Trusted Adult** | Talk to a parent, teacher, counselor, or another adult you trust. | They can help you navigate the situation, provide emotional support, and take further action if needed. |
| **7. Reach Out for Support** | Contact a helpline or online support group (e.g., 988 in the U.S., or local equivalents). | Professional counselors can help you process emotions and develop coping strategies. |
| **8. Keep Your Digital Footprint Safe** | Use strong, unique passwords; enable two‑factor authentication; avoid oversharing personal info. | Makes it harder for bullies to exploit your data. |
| **9. Consider Legal Action** | If the bullying includes threats, defamation, or stalking, consult a lawyer or law‑enforcement. | Legal avenues can provide protection orders or criminal charges. |
| **10. Take Care of Your Mental Health** | Practice self‑care: exercise, sleep, hobbies, and talk therapy if needed. | Reduces the emotional toll and helps you regain confidence. |
---
### Quick‑Reference Checklist
1. **Stop the interaction** – delete or ignore.
2. **Document** – screenshots, dates, usernames.
3. **Block**<|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 Profile Settings** | • Turn off location sharing.<br>• Set “Only Me” or “Friends” for sensitive posts.<br>• Disable “Show on Search” if you don’t want your profile indexed. | Reduces the amount of data that can be harvested by bots or malicious actors. | *Most platforms let you adjust these in the “Privacy” or “Settings” menu. Check them once a month.* |
| **2. Use Strong, Unique Passwords + 2FA** | • Create a password that’s at least 12 characters, mixes letters, numbers, and symbols.<br>• Never reuse passwords across sites.<br>• Enable two‑factor authentication (SMS, authenticator app, or hardware token). | Even if someone guesses or steals your password, 2FA adds a second barrier. | *Password managers (1Pass, LastPass, Bitwarden) can generate and store unique passwords for you.* |
| **3. Scrutinize Third‑Party Apps & Links** | • Review the permissions you grant to third‑party apps.<br>• Uninstall any app that requests more data than it needs.<br>• Avoid clicking on suspicious links or “unknown” friend requests. | Apps can harvest data, post on your behalf, or redirect you to phishing sites. | *Use the “Apps & Websites” section in your account settings to revoke access.* |
| **4. Think Before You Post** | • Don’t share exact addresses, phone numbers, or travel itineraries.<br>• Use “pseudonyms” or “handles” for public posts.<br>• Be cautious with “check‑ins” or location tags. | Public posts can be scraped, used for targeted ads, or even for identity‑theft. | *Enable “Location Off” on your phone when posting photos you don’t want to geotag.* |
| **5. Regularly Audit & Clean Up** | • Delete old posts that contain personal info.<br>• Review your friend list and remove people you no longer trust.<br>• Check your privacy settings after platform updates. | Platforms change their data‑collection policies; staying on top of it keeps you<|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 company you never interacted with.<br>• The contact claims you’ve won a prize, need to “verify” account info, or are being “suspended.” | Scammers often start with a surprise hook to lower your guard. |
| **Urgency or Threats** | • “Act now or lose your account.”<br>• “Your account will be closed if you don’t respond.” | Creates panic, making you act without thinking. |
| **Requests for Personal or Financial Info** | • “Please send your SSN, bank details, or credit card number.”<br>• “We need your login credentials to fix a problem.” | Legitimate companies never ask for passwords or full bank details via email or chat. |
| **Too Good to Be True Offers** | • “$10,000 in free cash for a quick survey.”<br>• “Get a brand‑new phone for $1.” | The price of the reward is often higher than the cost of the “fraud.” |
| **Unprofessional Communication** | • Spelling/grammar errors, odd phrasing, or generic greetings (“Dear Customer”).<br>• Links that don’t match the company’s domain (e.g., `www.paypal.com` vs. `www.paypall.com`). | Scammers often use low‑quality templates. |
| **Unusual Payment Methods** | • “Send money via wire transfer, prepaid debit card, or cryptocurrency.”<br>• “Pay with a gift card or a virtual card.” | These methods are hard to trace and recover. |
| **Requests for “Confidential” or “Secret” Info** | • “We’re moving your account to a new server; please confirm your details.” | Legitimate companies will never ask for “secret” data. |
| **Too Many “Friends” or “Followers” Claims** | • “You’re one of the 10,000 lucky winners.”<br>• “Your account has been flagged by 1,000 other users.” | Numbers are fabricated to create social proof. |
| **Unverified or Fake URLs** | • Links that redirect to a different domain or a page that1@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}