Views
No views yet
| Metric | Value |
|---|---|
| Base Model | openai/gpt-oss-20b |
| Architecture | Mixture-of-Experts Transformer |
| Total Parameters | ~18.5B (pruned from 21B) |
| Original Experts per Layer | 32 |
| Pruned Experts per Layer | 28 |
| 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-18.5b-specialized-safety-pruned-moe-only-28-experts",
7 torch_dtype=torch.bfloat16,
8 device_map="cpu",
9 trust_remote_code=True
10)
11tokenizer = AutoTokenizer.from_pretrained("AmanPriyanshu/gpt-oss-18.5b-specialized-safety-pruned-moe-only-28-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-18.5b-specialized-safety-pruned-moe-only-28-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-18.5b-specialized-safety-pruned-moe-only-28-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 concise advice.<|end|><|start|>assistant<|channel|>final<|message|>**If you or someone you know is being cyber‑bullied, here are practical steps to take right away:**
| Step | What to Do | Why It Helps |
|------|------------|--------------|
| **1. Don’t respond** | Ignore or block the bully’s messages. | Responding can fuel the conflict and give the bully more ammunition. |
| **2. Save evidence** | Take screenshots, copy messages, and note dates/times. | Proof is essential if you need to involve authorities, schools, or platforms. |
| **3. Report the content** | Use the platform’s “Report” or “Block” feature. | Most sites have policies against harassment and will remove or suspend the offending account. |
| **4. Adjust privacy settings** | Tighten who can see your posts, comment, or contact you. | Reduces the bully’s access to your personal information. |
| **5. Reach out for support** | Talk to a trusted friend, family member, teacher, or counselor. | Emotional support and practical advice can help you cope and decide next steps. |
| **6. Contact the platform’s help center** | If the bully is persistent or the content is illegal (threats, defamation, etc.), file a formal complaint. | Platforms are required to act on harassment and can provide additional resources. |
| **7. Notify relevant authorities** | If you feel threatened, harassed, or if the content is illegal, contact local law enforcement or a cyber‑crime unit. | Law enforcement can investigate and, if necessary, prosecute. |
| **8. Consider a restraining order** | For severe threats or stalking, a legal restraining order may be appropriate. | It provides a legal barrier and can be enforced by police. |
| **9. Keep a record of all interactions** | Maintain a log of dates, times, and what was said or done. | Useful for legal or school proceedings. |
| **10. Take care of your mental health** | Seek therapy, counseling, or support groups if you’re feeling anxious, depressed, or unsafe. | Professional help can help you process the experience and build resilience. |
### Quick‑Reference Checklist
1. **Block & ignore** the bully.
2. **Screenshot & log** all harassing content.
3. **Report** the user and the content to the platform.
4. **Adjust privacy** settings<|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** | • Set your profile to *Private* (or *Friends Only*). <br>• Review who can see your posts, photos, and personal info. <br>• Turn off location tagging by default. | Most data leaks happen because people share too much by default. | • In Facebook: Settings → Privacy → Who can see your future posts? <br>• In Instagram: Settings → Privacy → Private Account |
| **2. Think Before You Post** | • Ask: “Could this be used to find my address, phone number, or travel plans?” <br>• Avoid posting check‑ins, photos of your home, or details about upcoming trips. | Even a single post can be harvested by bots or used for phishing. | • Use a “safe” photo filter that blurs your home’s exterior. |
| **3. Use Strong, Unique Passwords & 2‑Factor Auth** | • Create a password manager (LastPass, 1Pass, Bitwarden). <br>• Enable 2‑Factor Authentication (2FA) on every account. | Password reuse is the #1 cause of account takeovers. | • For 2FA, use an authenticator app (Google Authenticator, Authy) instead of SMS. |
| **4. Scrutinize Third‑Party Apps & Permissions** | • Review the list of apps that have access to your account. <br>• Revoke any that you no longer use or that request unnecessary permissions. | Apps can harvest data or act as a back‑door. | • In Facebook: Settings → Apps and Websites → Remove. |
| **5. Stay Informed & Vigilant** | • Keep your OS, browser, and apps updated. <br>• Watch for phishing links or suspicious friend requests. <br>• Use a VPN when on public Wi‑Fi. | New threats emerge daily; staying current is your best defense. | • Install a reputable ad‑blocker (uBlock Origin) to reduce malicious scripts. |
---
## Quick “Do‑It‑Now” Checklist
| ✔️ | Action |
|----|--------|
| 1 | Switch your Instagram<|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 to be from a bank, government agency, or well‑known retailer. | Legitimate organizations rarely initiate contact without prior interaction. |
| **Urgency or Pressure** | • “Act now or lose your account.”<br>• “Your account will be closed if you don’t respond immediately.” | Scammers create a false sense of urgency to prevent you from thinking things through. |
| **Requests for Personal or Financial Info** | • “Please send me your Social Security number, credit card details, or login credentials.”<br>• “We need your password to verify your identity.” | No legitimate business will ask for passwords or full credit card numbers via email or chat. |
| **Too Good to Be True Offers** | • “Win a $10,000 gift card for free.”<br>• “Get a 90% discount on a luxury product.” | High rewards with minimal effort are classic bait. |
| **Unprofessional Communication** | • Numerous typos, grammatical errors, or odd phrasing.<br>• The email address or website URL looks suspicious (e.g., “@gmail.com” instead of a corporate domain). | Scammers often use generic or compromised accounts. |
| **Unusual Payment Methods** | • “Send money via wire transfer, prepaid debit card, or cryptocurrency.”<br>• “Pay with a gift card.” | These methods are hard to trace and recover. |
| **Requests for “Confidential” or “Secret” Information** | • “We’re conducting a confidential survey; we need your bank details.” | Legitimate surveys or studies never ask for sensitive data. |
| **Inconsistent or Vague Details** | • The sender’s name, title, or company details don’t match public records.<br>• The story changes or lacks specifics. | Scammers often use generic or fabricated identities. |
| **Links to Suspicious Sites** | • URLs that look similar to legitimate sites but have extra characters or misspellings.<br>• “Click here” links that redirect to unfamiliar domains. | Phishing sites mimic real ones to harvest credentials. |
| **Unexpected1@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}