NeMo Guardrails: A Toolkit for Controllable and Safe LLM Applications with Programmable Rails

code: https://github.com/NVIDIA/NeMo-Guardrails

为基于LLM的对话系统添加可编程guardrails。guardrails用于控制LLM的输出,例如过滤harmful topic, 遵循预定义对话路径,使用特别的语言风格等。在训练阶段,可以使用模型对齐的方式添加guardrail,而NeMo Guardrails允许开发者为LLM App添加独立于LLM且可解释的programmable rails。

Untitled

Background

Task-Oriented Dialogue Agents

使用NLU提取user message中的intent and slot,此后使用DM根据当前对话context预测下轮对话状态(dialogue state)。其中,intents和dialogue states由设计者预定义,且response是根据对话状态从封闭集中选择的。

NeMo Guardrails使用E2E方法来构建基于LLM的对话代理,但它结合了类似对话管理(DM)的运行时能力,能够解释和维护用Colang编写的对话流状态,与一个基于链式思维(CoT)的方法来使用LLM生成机器人消息,甚至是新的对话流程。

Approach

使用Colang定义LLM与用户交互时遵循的programmatic rails。

Untitled

Types of Guardrails