On the topic of LLM security, we explored OWASP top 10 for LLM applications, Llama guardAnd AI Lighthouz so far from different angles. Today we will explore NeMo guardrailan open source toolkit developed by NVIDIA to easily add programmable guardrails to LLM-based conversational systems.
How is NeMo Guardrails different from Llama Guard, which we dove into a previous article? Let’s put them side by side and compare their characteristics.
As we can see, the Llama Guard and NeMo guardrails are fundamentally different:
- Llama Guard is a large language model, refined from Llama 2, and an input-output backup model. It comes with six dangerous categories, and developers can customize these categories by adding additional dangerous categories to fit their use cases for IO moderation.
- NeMo Guardrails is a much more comprehensive set of LLM security tools, offering a broader set of programmable guardrails to control and guide LLM entry and exit, including content moderation, topic guidance, which guides conversations towards specific topics, prevention of hallucinations, which reduces the generation of facts. incorrect or absurd content and shaping of responses.
Let’s look at the implementation details on how to add NeMo Guardrails to a RAG pipeline built with
RecursiveRetrieverSmallToBigPack, an advanced recovery pack from LlamaIndex. How does this pack work? It takes our document and breaks it down, starting with the largest sections (parent pieces) and breaking them into smaller pieces (child pieces). It connects each child piece to its parent…