Ansari:一个基于检索增强的伊斯兰AI助手——14万次对话的架构、部署与经验教训
文章背景与核心概要
将通用大语言模型(LLM)应用于宗教内容时,往往容易出现两大风险:事实捏造(虚构古兰经经文或圣训)和微妙的价值观对齐偏差。为了缓解这些风险,本文介绍了 Ansari——一个经过实际部署、基于检索增强的伊斯兰AI助手。自2023年6月以来,该系统已处理了跨越25种以上语言的超过 14万次对话。
Ansari 运行在一个智能体检索循环(agentic retrieval loop)中,通过查询经过认证的伊斯兰文库(包括《古兰经》、核准的圣训集、多卷本教法(fiqh)百科全书以及经注(tafsir)来源),确保每一个回答都有直接的引用支持,以便用户进行核实。该研究不仅展示了其系统架构与多平台部署方案,还通过基准测试和真实世界交互,总结出了对任何涉及价值观与信仰的垂直领域AI开发都极具参考价值的经验教训。
📌 执行摘要
General-purpose Large Language Models (LLMs) often falter when applied to religious content, posing two major hazards: factual fabrication (inventing Qur'anic verses or hadiths) and subtle value misalignment.
通用大语言模型(LLM)在应用于宗教内容时往往表现不佳,主要带来两大危害:事实捏造(虚构古兰经经文或圣训)以及微妙的价值观对齐偏差。
To mitigate these risks, the authors introduce Ansari, a deployed, retrieval-grounded Islamic AI assistant that has processed over 140,000 conversations across 25+ languages since June 2023. Operating via an agentic retrieval loop, Ansari queries authenticated Islamic corpora—including the Qur'an, verified hadith collections, multi-volume jurisprudence (fiqh) encyclopedias, and exegetical (tafsir)-sources—ensuring every response is backed by direct citations for verification.
为了缓解这些风险,作者推出了 Ansari,这是一个经过实际部署、基于检索增强的伊斯兰AI助手。自2023年6月以来,该系统已处理了跨越25种以上语言的超过 14万次对话。Ansari 运行在一个智能体检索循环中,查询经过认证的伊斯兰文库——包括《古兰经》、核准的圣训集、多卷本教法(fiqh)百科全书以及经注(tafsir)来源——从而确保每一个回答都有直接的引用支持以供核实。
🏗️ 系统架构
Ansari's core technical framework is designed around high fidelity, reliability, and theological alignment:
Ansari 的核心技术框架围绕高保真度、可靠性和神学对齐进行设计:
- Agentic Retrieval Loop: A tool-using language model systematically issues search queries against validated Islamic databases.
- Corpora: Comprehensive, authenticated text sources including the Qur'an, canonical hadith collections, legal encyclopedias, and commentary (tafsir).
- Policy Enforcement: System prompts act as critical theological and editorial guideposts, directing the model to answer strictly from retrieved information.
- 智能体检索循环(Agentic Retrieval Loop): 一个具备工具使用能力的大语言模型系统性地针对经过验证的伊斯兰数据库发出搜索查询。
- 文库(Corpora): 全面且经过认证的文本来源,包括《古兰经》、权威圣训集、法律百科全书以及经注(tafsir)。
- 策略执行(Policy Enforcement): 系统提示词充当关键的神学和编辑路标,指导模型严格根据检索到的信息进行回答。
🌐 多平台部署
Ansari is built for accessibility across various user interfaces and technical ecosystems:
Ansari 旨在跨越不同的用户界面和技术生态系统实现广泛的可访问性:
- Web and Mobile applications
- WhatsApp integration
- Developer tools, functioning as a Model Context Protocol server and an Agent Skill
- 网页与移动端应用程序
- WhatsApp 集成
- 开发者工具,可作为模型上下文协议服务器(Model Context Protocol server)和智能体技能(Agent Skill)运行
📊 评估与性能
The paper assesses Ansari through multiple complementary benchmarks:
本文通过多个互补的基准测试对 Ansari 进行了评估:
- Zero-Shot Institutional Exams: Tested against accredited academic/religious exams.
- Human-Rated Validation: Conducted live during the holy month of Ramadan.
- External Benchmarks:
- Tops the public IslamicMMLU leaderboard, outperforming various frontier models.
- Demonstrates strong, competitive performance on Islamic legal reasoning (IslamicLegalBench) while displaying robust resistance to false premises.
- 零样本机构考试(Zero-Shot Institutional Exams): 针对经认证的学术/宗教考试进行测试。
- 人工打分验证(Human-Rated Validation): 在伊斯兰斋月期间进行现场测试。
- 外部基准(External Benchmarks):
- 登顶公开的 IslamicMMLU 排行榜,表现优于多种前沿模型。
- 在伊斯兰法律推理(IslamicLegalBench)上展现出强大且具有竞争力的性能,同时对虚假前提表现出强大的抵御能力。
💡 核心经验与普适性启示
The insights drawn from 140,000 real-world interactions extend beyond Islamic AI applications to any domain where values and faith intersect with AI:
从 14 万次真实世界交互中得出的见解,不仅适用于伊斯兰AI应用,还可延伸至任何价值观和信仰与AI交织的领域:
- Grounding is Necessary, but Insufficient: Technical retrieval prevents hallucination, but domain-specific contextual nuances require deeper constraints.
- The System Prompt as a Theological Artifact: Prompts function not just as technical instructions, but as keepers of cultural, ethical, and theological standards.
- The Community Gap: Current AI training pipelines still lack deep, community-driven integration in how models are shaped and evaluated.
- 检索增强是必要的,但并非充分条件: 技术检索可以防止幻觉,但特定领域的上下文细微差别需要更深层次的约束。
- 作为神学文物的系统提示词: 提示词不仅起到技术指令的作用,还是文化、道德和神学标准的守护者。
- 社区缺口: 当前的AI训练流程在模型的塑造和评估方式上,仍然缺乏深度的、由社区驱动的整合。