AI 平台/部署

使用 NVIDIA NIM 构建 AI 驱动的自动引用验证工具

引文的准确性对于保持学术和 AI 生成内容的完整性至关重要。当引用不准确或错误时,它们可能会误导读者并散布虚假信息。作为一支由悉尼大学机器学习和 AI 研究人员组成的团队,我们正在开发一种 AI-powered 工具,能够高效地交叉检查和分析语义引用的准确性。

提及事实声明可以帮助读者相信其有效性,增强作者的可信度,并通过显示信息来源来提高透明度。然而,确保语义引用的准确性(即确认声明不仅匹配,而且忠实地代表引用来源的结论,而不会失真或误解)非常耗时,而且通常需要深入的主题理解。

我们亲身经历了不准确的引用所带来的挫折和挑战,这促使我们开发了一个强大且可扩展的解决方案 — Semantic Citation Validation 工具。该解决方案简化了引文验证过程,并增强了各个领域的研究完整性。

随着 大语言模型 (LLM) 的日益普及,对引文验证的需求变得更加迫切。 检索增强生成 (RAG) 方法的最新进展有助于减少生成内容中的幻觉。但是,如果没有额外的验证方法,在建立可信度方面仍然存在重大挑战。

我们在开发 Research Impact Assessment App 时遇到了这个问题,该应用程序可为医学和健康领域的科学工作生成自定义影响报告。虽然功能强大,但该应用目前无法独立验证引用声明,也无法验证其与原始来源声明的一致性。

本文将介绍语义引文验证工具,该工具旨在加速验证过程、保持较高的准确性,并提供相关的上下文片段,以便更深入地理解所引用的材料。此工具通过将事实陈述与引用的文本进行比较,自动验证引用。它使用 NVIDIA NIM 微服务构建,并为主流 LLM API 提供商提供额外支持,将基于参考数据集训练的自定义微调模型与灵活的部署选项相结合。

Graphic showcasing an example of a citation search in a research paper. The text highlights studies on coffee consumption and cardiovascular effects as an example only, with a citation popup showing details of a referenced study. A thinking emoji with a monocle is depicted alongside speech bubbles asking, 'Fully supported?', 'What's missing?', and 'Misrepresentation?', emphasizing critical analysis of citation accuracy and representation."
图 1. 语义引文验证工具旨在确保引文陈述根据所引用的文档准确无误

技术实施和 NVIDIA 集成

2024 年 12 月,语义引文验证工具在 生成式 AI CodeFest 澳大利亚大会 上崭露头角,该活动聚焦于实用 AI 工具开发和技能增强。实施策略的核心是利用 NVIDIA NIM 生态系统开发基于微服务的应用,特别是使用 NVIDIA NeMo Retriever 执行嵌入和检索任务,以及使用微调语言模型进行语义分析和验证。NeMo Retriever 是微服务的集合,可提供出色的信息检索,并具有较高的准确性和更大的数据隐私性。

NVIDIA 核心组件包括:

  • 高级嵌入和重排序 :NVIDIA 专业服务可将文本转换为高维嵌入,并根据声明相关性对段落进行排序,从而通过优化的语义匹配显著减少内容过滤中的误报。
  • 由 LLM 提供支持的验证:使用适用于 LLM 的 NVIDIA NIM,该系统可以对已排名的段落进行深度语义分析,为符合专家判断的验证决策提供详细推理。
  • 模型微调 :为了优化准确性和处理速度,我们使用由引用声明、引用和验证结果组成的自定义数据集微调了 LLama 3.1 模型 (8B 和 70B 变体)。该数据集源自 2024 年引用次数最多的出版物,涵盖 Medicine、Physics、Mathematics、Computer Science、Geology 和 Environmental Science 等多个研究领域。提取并标注了 2023 年及以后的引文声明和参考资料。我们还使用 GPT-4o 生成的合成声明和注释来增强数据集。在模型训练中,我们使用了 8 块 NVIDIA A100 Tensor Core GPU ,GPU 总显存为 640 GB (由 NVIDIA 作为 Generative AI CodeFest Australia 的一部分提供)。

工作流架构

语义引文验证工具经过五个简化阶段的运行:

  1. 输入处理:通过具有内置格式验证和错误处理功能的强大接收系统处理引文语句和引用文档。文档上传程序支持文本、.pdf 和 .docx 文件。
  2. 文档处理 :执行格式验证、解析和战略分块,同时生成用于语义匹配的优化嵌入。它还使用 LLM 将引文文本处理为结构化声明。
  3. 向量管理 :实现文档和向量存储的双缓存架构,实现快速检索并减少处理开销。
  4. 匹配和分析 :以多层方法结合相似性匹配、重排序和 LLM 分析,实现全面验证。
  5. 输出生成:生成支持分类、验证推理、相关片段和 confidence scores。

处理流程使用 LangChain 和 ChromaDB 实现 RAG,并可以与 OpenAI 和 NVIDIA 语言和嵌入模型进行交互。图 2 概述了语义引文验证工具的流程流程。

A flowchart diagram showing an information processing pipeline with five main stages, color-coded in different boxes:
1) Input Processing (orange box): Shows a 'Referenced Document' going through a 'Format Check' diamond, with paths for 'Valid' and 'Invalid' (Format error). Includes a 'Citation Statement' and 'Key Information Extraction' component.
2 & 3) Parsing & Vector Management (blue box): Contains three connected components - 'Document Parser', 'Smart Chunking', and 'Vector Embeddings', connected to two storage systems: 'Document Cache' (Memory) and 'Temporary Vector Storage'.
4) Ranking, Retrieval, LLM Inference (green box): Shows a sequential process of 'Similarity Matching', 'Top-K Selection', 'Reranking', and 'LLM Semantic Analysis', with a 'Validation Check' component.
5) Output Generation (yellow box): Displays four classification boxes: Classification (Supported, Partially Supported, Unsupported, Uncertain), Reasoning, Supporting Snippets (Text Chunk 1, Text Chunk 2), Confidence Score.
图 2。Semantic Citation Validation 工具的流程流程,说明从输入处理到验证结果的关键阶段

Web 应用程序概述和主要功能

作为初始原型,我们使用 Streamlit 开发了直观的 Web 界面,使引用验证工具易于访问,并简化了自动引用验证的工作流程。

用户可以直接输入引文语句和参考文件,如下例所示。系统会处理这些信息并生成三个关键输出:

  • “分类 (在本例中显示为 PARTIALLY_SUPPORTED)”
  • 分类的详细推理 (在本例中列出有关核心发现、缺失上下文和年龄范围的三个具体点)
  • 源文本中的相关支持片段
Graphic demonstrating how AI Citation Check automates citation validation against referenced documents. The left side shows an input section with two components: 'Citation Statement' (for example, 'Smith et al. (2023) found that coffee consumption reduces risk of heart disease by 15%') and 'Reference Text' providing detailed study context (e.g., findings limited to filtered coffee and unclear causality). The output section includes a classification ('Partially Supported'), reasoning highlighting missing details (such as filtered coffee context and age range), and supporting snippets from the reference text. The right side shows the Citation Check interface, where users upload reference documents and citation text to verify claims. Emphasis text explains how the tool processes citations for accuracy.
图 3。语义引文验证应用的用户界面和功能

利用 NVIDIA 微服务实施 LLM、文档检索和排序

配置界面通过灵活的 LLM 提供商选择、优化的嵌入服务以及使用 Chroma vector store 和 FlashrankRerank 的强大检索机制来展示核心 NVIDIA 集成。本地端点配置可确保安全处理敏感数据,同时保持性能。

A diagram showing the configuration options for a semantic citation analysis tool. It consists of two main boxes: "Model Configurations" on the left and "Embedding Configuration" on the right, with arrows connecting them. The left box shows options for LLM Provider (NVIDIA or OpenAI), LLM Model Name, Temperature, and Model Endpoint URL. The right box shows options for Embedding Provider (NVIDIA), Embedding Model Name, and Embedding Endpoint URL. Callout boxes highlight key features: "LLM Provider Support: Interact with either NVIDIA or OpenAI Language Models," "Embeddings: Use NVIDIA or OpenAI embeddings for vectorization," "Retrieval and Ranking: Use Chroma Vector Store and Flashrank Rerank," and "Local cluster: Run endpoints locally for confidential data." The diagram emphasizes the tool's flexibility and modularity.
图 4。模型配置界面,重点介绍用于 LLM 处理和文档检索的 NVIDIA NIM 微服务集成

准确性分类

验证工具通过四个不同的类别提供细致入微的引用评估:

  • 支持:指示完全对齐和正确的上下文
  • 部分支持 :显示受支持的核心声明,但缺少上下文或细微差别
  • 不支持: 对于与来源不符或来源缺失的索赔
  • 不确定: 适用于信息不明确或不充分的情况

该分类方案旨在平衡粒度和简单性,确保研究人员和��查人员的潜在行动保持一致。支持的引用无需更改,部分支持的引用可能需要进行细微修改,不支持的引用需要进行重大修改或删除,并且不确定的案例需要进一步审查。

Graphic explaining the Reference Cross-Checker Classifications system. Four categories are presented:
Supported: Full alignment with the source, proper context, and complete representation (green).
Partially Supported: Core claim supported but missing nuances, context, or oversimplified statements (orange).
Unsupported: Not found in the source, contradictions to the reference, or misrepresentation (red).
Uncertain: Ambiguous claims, insufficient context, or unable to verify (purple).
On the right, the Citation Check interface processes a sample citation. It outputs a "Partially Supported" classification with a confidence score of 0.80 and detailed analysis explaining the original claim, processed claim, and discrepancies.
图 5。显示应用程序输出类别和验证接口的 Citation classification framework

推理和支持证据

该工具还通过分析引文和源文本之间的具体差距 (例如缺失的细节、方法上的细微差别、上下文遗漏或对结果的潜在曲解) ,为其分类提供详细的推理。支持证据通过参考文档中的相关文本片段提供,并附带相关性分数,使用户能够直接验证工具的决策过程。

Screenshot of an NVIDIA tool interface for semantic citation validation. The interface is divided into sections: "Output 2" displays a user's claim about research findings. "Output 3" shows relevant excerpts from research papers with highlighted sections and relevance scores. "Reasoning" provides an AI-generated explanation comparing the claim and evidence, noting consistencies and discrepancies. The overall interface is clean and designed for technical users. The text at the top of the image reads "Streamlining citation reviews, saving time, and enhancing research accuracy and quality."
图 6。推理和证据输出,显示详细分析和源文本验证

总结

语义引文验证工具通过将事实陈述与引用文本进行比较来自动验证引文。它使用 NVIDIA NIM 微服务构建,并为主流 LLM API 提供商提供额外支持,将基于参考数据集训练的自定义微调模型与灵活的部署选项相结合。该工具执行语义声明验证并提取支持证据,将引用分为四类:支持、部分支持、不支持和不确定。该工具可轻松部署为 Web 应用程序,实现对引文的系统审查,将检查时间从几小时缩短到几秒钟,同时提高研究的准确性和质量。

未来,我们计划简化引文验证过程。我们将实现从任何文档中自动引用和引用,以及开源引用的完整文本检索。这种增强功能将消除手动输入要求,显著缩短传统学术内容和 AI 生成的输出的验证时间。这将通过与学术数据库和预打印服务器集成,实现直接的来源检索和验证。

进一步的开发包括同时处理多次引用的批量处理功能,使其对文稿编辑、系统审查和快速验证 AI 生成的内容非常重要。这些改进将把该工具转变为全面的引用完整性解决方案,支持研究人员、编辑团队和内容创作者在人类创作和 AI 生成的作品中保持高标准的准确性。有关更多信息和更新,请访问 RefCheckAI

探索 NVIDIA NIM ,加速 AI 开发并解决实际挑战。详细了解 NIM 及其构建创新解决方案的功能,例如此引文验证工具。

致谢

这项工作在澳大利亚生成式 AI Codefest ( Open Hackathons 计划的一部分) 上完成。我们感谢 OpenACC-Standard.org 的支持。我们在此感谢澳大利亚工业、科学和资源部通过国家 AI 中心和国家计算基础设施 (NCI) 与 NVIDIA 和 Sustainable Metal Cloud (SMC) 共同举办生成式 AI CodeFest 澳大利亚大会。该项目得到了悉尼大学悉尼信息学中心 (SIH) 的支持。

标签