Update README.md
Browse files
README.md
CHANGED
|
@@ -7,4 +7,84 @@ sdk: static
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
pinned: false
|
| 8 |
---
|
| 9 |
|
| 10 |
+
\'Let OddRam Protect!\'
|
| 11 |
+

|
| 12 |
+
|
| 13 |
+
# OddRam #
|
| 14 |
+
|
| 15 |
+
[OddRam is a *space* created for collecting [OpenDawg](http://opendawg.com)'s research on *Guardrails*, *Safety*, *Ethics* & *Morals* for **LLM**s.]
|
| 16 |
+
|
| 17 |
+
Although LLMs were initially issued without particular attention to safety, the advent of widely used apps without particular attention paid to age verification or jurisdiction, has led to a need for some degree of model safety.
|
| 18 |
+
|
| 19 |
+
e.g. Even notes around fairly recent releases of LLama models suggest it is up to the developer/user to add guardrails themselves, such as LLamaGuard[1].
|
| 20 |
+
|
| 21 |
+
Whilst "Instruct" variations of LLMs generally have some additional training and tuning to encourage the model to act as a helpful assistant, rather than as an auto-complete or 'Raw' model, LLMs were perceived as not sufficiently trained to shut down many queries about unsafe, unsavoury or illegal subjects.
|
| 22 |
+
|
| 23 |
+
This appears to have led to different approaches from the model releasing community:
|
| 24 |
+
1. **Fix The Training data**.
|
| 25 |
+
New models may have extensive "cleaning" of training data sets to remove unwanted inputs. This may be done manually or synthetically, probably mostly the latter. Essentially trying to mitigate the 'garbage in garbage out' syndrome.
|
| 26 |
+
2. **Guards**.
|
| 27 |
+
LLama Guard makes reference to Anthropic's safety training research[2], using their 'Red book'[3]\* & other data to fine-tune train their own LLM to help warn application developers of 'unsafe' conversations. This had the issue of requiring multiple LLMs to be running, though newer models could add specific Guard layers in a similar way that they add the image or audio functionality layers. Also, some issues may not have been addressed around multi-language safety as early data sets were predominantly in English. See [CultureGuard](https://arxiv.org/abs/2508.01710v4)[4] for an Nvidia researched partial solution.
|
| 28 |
+
3. **Programmatic Solutions**.
|
| 29 |
+
Other traditional programmatic methods of cleaning language and 'hot' words, but not using AI. e.g. This might include 'clean lists' of approved words.
|
| 30 |
+
4. **Fine Tuning**.
|
| 31 |
+
Make variations of core models that have had extensive tuning against moderated data sets in specialist areas. You have to do this each time a base model gets an update, but e.g. LoRA is generally much quicker and far less compute intensive than training a new model from scratch because of initial training data issues.
|
| 32 |
+
5. **Context injections**.
|
| 33 |
+
As maximum context window sizes expand and the major AI players start to monetize 'token burn', injecting few shot style training in the context window can both rapidly direct conversations away from hot topics and reduce unwanted output whilst increasing the bottom line $$$. It is certainly easier than running fine-tuning training repeatedly each time a model gets updated. This can be seen as a 'Few Shot' approach, but that term could also apply to a very limited LoRA training session.
|
| 34 |
+
6. **Zero shot**.
|
| 35 |
+
If your user query includes specific instructions and examples, you may be able to guide the conversation response, although useless for corporate responsibility for user safety it may still be helpful for when you want answers with specific morals & ethics considered.
|
| 36 |
+
|
| 37 |
+
If you need an extra 'Guardrail' it probably depends on the level of built-in training for a model. Helpfully, research resulting in tools like [SweEval](https://arxiv.org/abs/2505.17332v1)[5] helps you evaluate a model's built in performance on dealing with swear words.
|
| 38 |
+
|
| 39 |
+
> \*Disclaimer: The data (especially the harmlessness preference data and the red team data) contain content that may be offensive or upsetting. Topics include, but are not limited to, discriminatory language and discussions of abuse, violence, self-harm, exploitation, and other potentially upsetting subject matter. Please only engage with the data in accordance with your own personal risk tolerance.
|
| 40 |
+
|
| 41 |
+
---
|
| 42 |
+
|
| 43 |
+
### References ###
|
| 44 |
+
|
| 45 |
+
[1] **Llama Guard: LLM-based Input-Output Safeguard for Human-AI Conversations**
|
| 46 |
+
Hakan Inan, Kartikeya Upasani, Jianfeng Chi, Rashi Rungta, Krithika Iyer, Yuning Mao, Michael Tontchev, Qing Hu, Brian Fuller, Davide Testuggine, Madian Khabsa
|
| 47 |
+
https://arxiv.org/abs/2312.06674
|
| 48 |
+
[v1] Thu, 7 Dec 2023 19:40:50 UTC
|
| 49 |
+
huggingface.co [MODEL_CARD.md](https://github.com/meta-llama/PurpleLlama/blob/main/Llama-Guard/MODEL_CARD.md)
|
| 50 |
+
of original Llama Guard created using Llama2 7B
|
| 51 |
+
- huggingface's meta-llama LLama Guard model cards.
|
| 52 |
+
- [Guard 1](https://github.com/meta-llama/PurpleLlama/blob/main/Llama-Guard/MODEL_CARD.md)
|
| 53 |
+
- [Guard 2](https://github.com/meta-llama/PurpleLlama/blob/main/Llama-Guard2/MODEL_CARD.md)
|
| 54 |
+
- [Guard 3](https://github.com/meta-llama/PurpleLlama/blob/main/Llama-Guard3/README.md) &
|
| 55 |
+
- [Guard 4](https://github.com/meta-llama/PurpleLlama/blob/main/Llama-Guard4/README.md)
|
| 56 |
+
|
| 57 |
+
---
|
| 58 |
+
[2] **Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback**
|
| 59 |
+
Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova DasSarma, Dawn Drain, Stanislav Fort, Deep Ganguli, Tom Henighan, Nicholas Joseph, Saurav Kadavath, Jackson Kernion, Tom Conerly, Sheer El-Showk, Nelson Elhage, Zac Hatfield-Dodds, Danny Hernandez, Tristan Hume, Scott Johnston, Shauna Kravec, Liane Lovitt, Neel Nanda, Catherine Olsson, Dario Amodei, Tom Brown, Jack Clark, Sam McCandlish, Chris Olah, Ben Mann, Jared Kaplan
|
| 60 |
+
https://arxiv.org/abs/2204.05862
|
| 61 |
+
[v1] Tue, 12 Apr 2022 15:02:38 UTC
|
| 62 |
+
|
| 63 |
+
---
|
| 64 |
+
[3] Relevant huggingface.co Dataset Card: [Anthropic/hh-rlhf](https://huggingface.co/datasets/Anthropic/hh-rlhf)
|
| 65 |
+
|
| 66 |
+
---
|
| 67 |
+
[4] **CultureGuard: Towards Culturally-Aware Dataset and Guard Model for Multilingual Safety Applications**
|
| 68 |
+
Raviraj Joshi, Rakesh Paul, Kanishk Singla, Anusha Kamath, Michael Evans, Katherine Luna, Shaona Ghosh, Utkarsh Vaidya, Eileen Long, Sanjay Singh Chauhan, Niranjan Wartikar
|
| 69 |
+
https://arxiv.org/abs/2508.01710v4
|
| 70 |
+
[v4] Sun, 9 Nov 2025 11:10:40 UTC
|
| 71 |
+
huffingface.co [Nemotron-Safety-Guard-8B-v3](https://huggingface.co/nvidia/Llama-3.1-Nemotron-Safety-Guard-8B-v3)
|
| 72 |
+
|
| 73 |
+
---
|
| 74 |
+
[5] **SweEval: Do LLMs Really Swear? A Safety Benchmark for Testing Limits for Enterprise Use**
|
| 75 |
+
Hitesh Laxmichand Patel, Amit Agarwal, Arion Das, Bhargava Kumar, Srikant Panda, Priyaranjan Pattnayak, Taki Hasan Rafi, Tejaswini Kumar, Dong-Kyu Chae
|
| 76 |
+
|
| 77 |
+
https://arxiv.org/abs/2505.17332v1
|
| 78 |
+
[v1] Thu, 22 May 2025 22:56:58 UTC
|
| 79 |
+
|
| 80 |
+
---
|
| 81 |
+
|
| 82 |
+
### Code Samples ###
|
| 83 |
+
|
| 84 |
+
```python
|
| 85 |
+
#Python code for PyTorch & Transformers
|
| 86 |
+
|
| 87 |
+
print("Hello World!")
|
| 88 |
+
# OK, the actual example code is to be inserted here
|
| 89 |
+
# ...but much later.
|
| 90 |
+
```
|