基于图谱和智能体的法律文档 GraphRAG案例深度解析 - WhyHow.AI

Legal Document RAG: Multi-Graph Multi-Agent Recursive Retrieval through Legal Clauses | by Chia Jeng Yang | WhyHow.AI | Sep, 2024 | Medium

摘要

本文介绍了一种利用多图多智能体递归检索方法,通过构建法律文档的词法图谱和定义图谱,实现对法律文档中条款的智能导航和信息检索,并与ChatGPT的结果进行了比较,展示了该方法的优势。

Key Takeaways:

* 本文提出了一种基于多图谱多智能体递归检索的法律文档RAG系统,能够更精准地回答问题。

* 该系统构建了法律文档的词法图(文档层次结构)和定义图,并利用多代理系统进行递归检索。

* 该系统使用了Reducto.AI、WhyHow.AI、Langgraph和LlamaIndex等技术。

* 与ChatGPT相比,该系统能够更准确地识别和检索相关条款,避免遗漏关键信息。

* 该系统包含多个智能体,分别负责初始搜索、定义检索、路由、递归检索和答案生成。

* WhyHow.AI的知识图谱平台简化了构建模块化、智能知识图谱的过程。

* 文章最后附带了部分智能体的代码片段。

原文:

https://medium.com/enterprise-rag/legal-document-rag-multi-graph-multi-agent-recursive-retrieval-through-legal-clauses-c90e073e0052

正文

在本文和开源存储库中,我们想演示通过多代理系统完成法律文件条款的智能导航,该系统利用监管文档的多图形多代理工作流中的词法图(文档层次结构)和块链接。我们在这里使用的堆栈是 Reducto.AI、WhyHow.AI、Langgraph、LlamaIndex。您可以在此处找到对开源存储库的访问权限。

https://github.com/whyhow-ai/recursive-retrieval

我们在文件中,特别是法律文件中遇到的一些非常具体的问题是,需要建立文档内不同条款的文档层级。这是因为条款有时会引用其他条款以获取完整的含义和上下文。

为了获得完整的上下文,您必须递归地导航和检索任何提到的子句(甚至脚注),导航文档层次结构图以查找提到的子句,查看是否提到了任何其他子句,然后重复。递归检索可以在法律文档之外的一系列其他文档元素上完成,包括页码、多模态数据(如图像)、指向其他文档或外部数据的超链接等。

考虑到文档的结构化性质,当涉及到基于图形的遍历和检索时,法律文档一直让我着迷。还有一个非常具体的结构化检索步骤,该步骤也必须始终以定义页面为幌子在法律文档的上下文中进行,其中每个特定的重要术语都有一个非常具体的变量或固定定义,该定义可能会根据文档的性质而改变。

在此 Notebook 和示例中,我们希望展示如何轻松创建法律文档中条款的文档层次结构图谱、法律文档中的定义图谱,以及多图谱多智能体递归检索过程,该过程通过智能地浏览文档层次结构图和定义图来回答问题,以获得针对它提出的问题的完整上下文。

在此示例中,我们采用马来西亚中央银行发布的简单监管文件,特别是管理各种组织中的合规性规则的文件。

我们想要回答的问题是:- 董事会和 CCO 如何管理控制职能?

回答这个问题的理想流程是:

  • 从定义页面提供 CCO 的定义

  • 从第6.3条和第7.2条中检索信息。

  • 检测到第 7.2 条中的“请参阅第 7.3 段和第 7.4 段”。

  • 遍历并检索第 7.3 和 7.4 段

  • 检测提及 9.1 段和检索 9.1 段

作为一个快速的基准测试,当我们使用 GPT4o(嵌入了代理推理)通过 ChatGPT 运行它时,我们得到以下答案:

The management of control functions by the Board and the Chief Compliance   
Officer (CCO) involves several key responsibilities as outlined in the   
compliance document:  
  
Responsibilities of the Board:  
1\. Oversight of Compliance Risk Management: The Board is responsible for   
overseeing the management of compliance risk within the financial institution. This includes approving the compliance policy, establishing the compliance function, and appointing the CCO.  
2\. Approval and Support for the Compliance Function: The Board must   
ensure that the compliance function and the CCO have the appropriate standing,   
authority, and independence to carry out their duties effectively. The Board   
must also ensure that the compliance function is adequately resourced.  
3.Engagement with the CCO: The Board should engage with the CCO regularly to   
discuss issues faced by the compliance function and ensure the CCO has direct   
access to the Board.  
4\. Annual Evaluation: The Board must evaluate the effectiveness of the   
institution’s management of compliance risk at least annually, considering   
assessments from senior management, internal audit, and the CCO.  
  
Responsibilities of the Chief Compliance Officer (CCO):  
1\. Coordination and Management of Compliance Risk: The CCO is responsible for   
coordinating the identification, management, and monitoring of compliance risk  
across the institution. This includes ensuring compliance monitoring and   
testing are consistent across the organization.  
2\. Reporting and Advising: The CCO must report regularly to senior management   
on the findings and analysis of compliance risks and must ensure that reports   
are readily available to internal audit and regulatory authorities. The CCO   
also advises the Board and senior management on legal and regulatory   
requirements, keeping them informed of developments and their implications.  
3\. Independence: The CCO must maintain independence from business lines to   
effectively carry out the role of a control function. This includes ensuring   
that there is no conflict of interest in their responsibilities, reporting   
lines, or remuneration.  
4\. Resources and Training: The CCO must ensure that the compliance function   
is sufficiently resourced with officers who have the necessary qualifications   
and experience. The CCO is also responsible for ensuring that adequate training  
 is provided to officers on relevant legal and regulatory requirements.  
  
Interaction with Other Control Functions:  
The compliance function should be organized in a way that allows effective   
management of compliance risk, considering the size, nature, and complexity of  
the financial institution’s operations. Where responsibilities are shared   
between a dedicated compliance unit and other control functions,  
clear documentation and coordination are required to ensure that the CCO can   
perform their duties effectively without impairing independence or focus.  
By fulfilling these responsibilities, the Board and the CCO can ensure that   
the institution's compliance risks are managed effectively, supporting the   
overall safety and soundness of the financial institution.

这个答案很有趣,但并不完整,因为它:

  • 似乎特别提到了关键词“合规”,并强调了与其他条款相关的所有合规义务,而不是专门针对董事会和 CCO。例如,在“合规”的背景下提出了跨司法管辖区的协调(第 8.2 段),在“合规”的背景下提出了薪酬独立性(第 7.8 段)。

  • 至关重要的是,它似乎遗漏了对第 7.3 段和第 7.4 段的明确引用,这些段落明确规定了董事会与 CCO 之间关于当 CCO 共享控制职能时需要董事会批准的关键义务。它还遗漏了第 9.1 段关于审计和合规职能之间的分离。

这是可以理解的,因为子句、页面和页脚的递归检索并不是控制 RAG 的典型语义相似性检索过程的明确部分。

开发的多图谱多智能体工作流程摘要

对于那些希望了解每个代理的作用的人,我们在附录中提供了每个代理的代码片段

图谱的创建

在此 Notebook 中,我们首先用 Reducto 的文档摄取引擎提取解析文档结构,https://reducto.ai/。文档结构将每个页面分解为不同的元素,例如节页眉、列表项或页脚。

然后,根据元素的显示顺序及其隐含的层次结构(例如,Section Header 是 List Item 的父级)来组合这些元素。然后,我们分析文档中的链接,以确定可以在词法图中建模的提取元素之间的联系。

链接到文档层次结构/词法图

然后,我们使用此处的 SDK 将 chunk 和 triples 导入 WhyHow 的 Knowledge Graph Studio 以创建词法图谱。

https://whyhow-ai.github.io/whyhow-sdk-docs/examples/create_graph_from_triples/

我们还为文档构建了法律定义的图谱。在法律文件中,每个文件都有一个定义部分,有助于定义必须解释某些术语的具体方式。这可能因文档、用例和客户端而异。在本例中,文档在第 4-5 页包含定义。这些文本被提取并传递到 GPT-4o 中,并提示逐字提取法律术语及其定义并将其作为结构化输出返回。输出将转换为 CSV 文件,并使用 SDK 和预定义架构作为单独的图谱上传。定义智能体在需要时调用此定义图,以使用特定的相关定义来扩充上下文。在这种情况下,在检索初始子句后调用 Definition Agent。

链接到定义图谱 https://whyhowai.netlify.app/public/graph/66d7edbaeda622fc957cc73f

然后,我们将节点从 WhyHow 导入到笔记本中,并使用 LlamaIndex 在本地为节点的信息编制索引,保留使用 WhyHow 生成的嵌入。我们使用 LlamaIndex 的 Vector、BM25 和 Keyword 检索器的组合。在查询和检索过程需要精确术语的法律文档使用案例中,添加 BM25 和关键字检索器非常有用。BM25 有助于识别高度重复文本中的关键术语,而关键字检索器可确保根据需要检索重要术语,尽管这些术语出现频率不高。

LangGraph 用于通过 WhyHow SDK 和 GPT-4o 围绕词法图构建多代理工作流,本质上,当查询通过时,系统首先通过 Initial Search Agent 搜索相关的向量块。在这种情况下,向量块是子句或子子句。随后在此处调用 Definition Agent,以使用相关定义来扩充子句。然后,Router Agent 会检测是否需要引用其他链接的节或页脚,如果有,则检索相应的节并考虑它们。如果后续检索到的子句(如此处的情况)引用了更多的子句,则递归检索代理将递归地执行此操作。

它检索的第一个子句是第 6.3 段和第 7.2 段。引用 Definitions Graph 以检查是否应包含定义部分的任何其他上下文。包括“CCO”和“高级管理人员”的其他定义。

在第 6.3 段中,有以下第 6.3.f 段:

  • “如果 CCO 还履行其他控制职能方面的职责 3,请确信良好的整体控制环境不会因 CCO 履行的职责组合而受到损害。”

然后,根据它检索的第一个子句的信息,Router Agent 会帮助检测材料中是否提到了子句或页脚。在这种情况下,页脚 (脚注 3) 与第一个子句相关联。然后,路由器代理会触发页脚解析代理。页脚解析代理标识相关页脚并返回以下页脚:

  • “请参阅第 7.3 和 7.4 段。”

在这里,需要另一个遍历,并且 Recursive Retrieval Agent 用于遍历词法图并检索段落 7.3 和 7.4 中的块/子句。

第 7.3 和 7.4 段中的这些新信息被合并在一起。第 7.4(b) 段引用了第 9.1 段。这里:

  • “合规职能的职责不能与内部审计分担,CCO 也不能承担内部审计的责任,因为这种做法会导致第 9.1 段中描述的独立审查流程无效。”

第 7.4 段包含指向第 9.1 段的链接,Router Agent 检测到该链接,并指示递归检索代理在下一次传递时检索它。应答代理跟踪所有传入的信息,以汇总并最终制定最终答案以返回给用户。

构建的最终答案反映了我们理想的流程,并从定义页面、第6.3和7.2段、页脚注释3、第7.3、7.4、9.1段中获取信息,并准确地为用户总结了所有相关信息。

为了确保我们不仅运气好,我们还运行了 3 次最终查询,结果显示成功检索了相关信息。

To manage control functions effectively, the Board and the Chief Compliance   
Officer (CCO) have distinct responsibilities that they must exercise:  
  
Responsibilities of the Board:  
\- Approve critical decisions regarding the CCO, including appointment,   
remuneration, and termination (Section 6.3(a)).  
\- Ensure the CCO has sufficient stature to engage effectively with senior   
management (Section 6.3(b)).  
\- Regularly engage with the CCO to discuss compliance issues and consider   
interactions without senior management present (Section 6.3(c)).  
\- Provide the CCO with unimpeded access to communicate with the board directly  
(Section 6.3(d)).  
\- Support the CCO with adequate resources to perform duties effectively,   
including competent staff (Section 6.3(e)).  
\- Satisfy themselves that combined responsibilities, if any, do not compromise  
the control environment (Section 6.3(f)).  
  
Responsibilities of the CCO:  
\- Coordinate the identification and management of institution-wide compliance   
risks (Section 7.2(b)).  
\- Ensure consistent conduct of compliance monitoring and testing across the   
organization (Section 7.2(b)).  
\- Maintain independence and sufficient focus on compliance duties, even when   
tasked with additional control functions (Section 7.3).  
  
Shared Responsibilities & Coordination:  
\- The board must approve any sharing of compliance function responsibilities   
between the compliance unit and other control functions (Section 7.4(a)).  
\- Function responsibilities, including timely communication of issues, should   
be well-defined and documented (Section 7.2(a)).  
\- Effective arrangements for coordination among control functions should be in  
place to facilitate the CCO’s responsibilities (Section 7.2(d)).  
\- Compliance responsibilities must not compromise the separation of the   
internal audit function (Section 9.1).  
  
The board should ensure comprehensive oversight, and the CCO should maintain  
effective coordination and communication across the organization to manage  
control functions efficiently.

总之,通过这个练习,我们已经开发出一个展示以下内容的系统:

  • 一个多图系统,每个图代表RAG系统中不同的过程和目标。

  • 创建具有RAG能力的自动化词汇图,使用Reducto、WhyHow和LlamaIndex

  • 一个多智能体系统,允许基于文档希望人类阅读和浏览其信息的方式智能遍历文档,以结构化的方式返回每个部分和小节的答案。

  • 一个由LangGraph管理的多图多智能体系统。

WhyHow.AI的知识图谱工作室平台(目前处于测试阶段)是构建模块化、自主知识图谱的最简单方式,结合了大型语言模型、开发人员和非技术领域专家的工作流程。

如果您正在考虑、正在进行,或已经在RAG中结合知识图谱以提高准确性、记忆性和确定性,关注本公众号的文章,也可以访问WhyHow.AI或者加入Discord https://discord.gg/9bWqrsxgHr,讨论RAG中的规则、确定性和知识图谱。

附录

智能体代码片段

定义智能体

  • 检索查询中提到的术语的定义。
def definitions\_search(query\_prompt: str, client: Optional\[WhyHow\]=None) \-> Dict\[str, str\]:  
    """  
    Search for definitions of terms in a question prompt and return them as a dictionary.  
    """  
    if client is None:  
        client = WhyHow(api\_key=WHYHOW\_API\_KEY, base\_url=WHYHOW\_API\_URL)  
  
    definitions\_response = client.graphs.query\_unstructured(  
        graph\_id=definitions\_graph.graph\_id,  
        query=query\_prompt,  
    )  
      
    response\_text = definitions\_response.answer  
    term\_def\_pairs = response\_text.split('\\n')  
    definitions\_dict = {}  
      
    for pair in term\_def\_pairs:  
        if ':' in pair:  
            term, definition = pair.split(':', 1)  
            definitions\_dict\[term.strip()\] = definition.strip()  
      
    return definitions\_dict  
  
query\_prompt = """Return me definitions for the terms in this query: "How can the Board and the CCO manage control functions?" Ensure the term-definition pairs are separated by newlines, properly capitalised"""  
  
definitions\_dict = definitions\_search(query\_prompt)  
  
  
def print\_prompt\_definitions\_dict(definitions\_dict):  
    prompt = "Relevant Definitions:\\n"  
    for term, definition in definitions\_dict.items():  
        prompt += f"{term}: {definition}\\n"  
    return prompt  
  
print(print\_prompt\_definitions\_dict(definitions\_dict))

路由器代理

  • 决定进程是应停止还是继续。此外,标识包含页脚信息或指向要由递归检索智能体检索的其他节点的链接的相关节点。
def router\_agent(state: AgentState) -> AgentState:  
    \# decide if process should should stop or continue  
  
    starter\_prompt\_footer = f"""  
        You are an intelligent agent overseeing a multi-agent retrieval process of graph nodes from a document. These nodes are to answer the query:   
        \`\`\`{state\['query'\]}\`\`\`  
          
        Below this request is a list of nodes that were automatically retrieved.   
          
        You must determine if the list of nodes is enough to answer the query. If there isn't enough information, you must identify any relevant footer information in the nodes.  
          
        A node can footer information asking to look in another section/part of the document, which will require a separate natural language search.   
        Example: If the footer says "see paragraph x", a search query e.g. "Return paragraph x to answer the query '{state\['query'\]}'" should be made.   
      
        If there are no further nodes worth analyzing, return an empty response. ONLY RETURN QUERIES FOR FOOTERS THAT ARE RELEVANT TO ANSWERING THE QUERY  
          
        Else, if any relevant nodes require a footer search, specify the node\_id and the search query.  
        Nodes are identified by node\_id and must be quoted in backticks.       
    """  
      
    starter\_prompt\_link = f"""  
        You are an intelligent agent overseeing a multi-agent retrieval process of graph nodes from a document. These nodes are to answer the query:   
        \`\`\`{state\['query'\]}\`\`\`  
          
        Below this request is a list of nodes that were automatically retrieved.   
          
        You must determine if the list of nodes is enough to answer the query. If there isn't enough information, you must identify any linked nodes that could be worth exploring.  
          
        If there are no further nodes worth analyzing, return an empty response.  
          
        Return a list of node\_ids. ONLY RETURN NODE\_IDS for NODES THAT ARE RELEVANT TO ANSWERING THE QUERY. Nodes are identified by node\_id and must be quoted in backticks.  
    """  
      
    \# collect latest nodes, and all nodes  
    last\_fetched\_nodes\_flattened: Dict\[str, MultiAgentSearchLocalNode\] = {}  
    all\_nodes\_flattened: Dict\[str, MultiAgentSearchLocalNode\] = {}

主管代理

  • 监控上下文窗口,并在使用过多上下文时修剪节点。

  • 如果未找到页脚搜索或链接节点的节点或相关信息,还会跟踪搜索失败。如果重复搜索失败的情况太多,则会提前结束检索过程。

def supervisor\_agent(state:AgentState) -> AgentState:  
      
    \# Look for search failures. This might be an instance where multiple searches were made for certain parts of the document, but no relevant information was found.  
    \# This means that the search has to be ended prematurely to prevent infinite loops.  
    printout = ""  
    for node in state\["previous\_nodes"\]:  
        printout += node.print\_node\_prompt()  
    for node in state\["last\_fetched\_context\_nodes"\]:  
        printout += node.print\_node\_prompt()  
          
    prompt = f"""  
You are a supervisor agent overseeing the multi-agent retrieval process of graph nodes from a document. The nodes are to answer the query:  
\`\`\`{state\['query'\]}\`\`\`  
  
  
Below is a list of nodes that were automatically retrieved, followed by a list of errors. If there are many similar, repeated errors in the retrieval process , where no further linked or relevant nodes could be retrieved, return END to end the process. Else return CONTINUE.   
Return only a single word, either END or CONTINUE.  
"""  
      
    completion = openai\_client.beta.chat.completions.parse(  
        model="gpt-4o-2024-08-06",  
        messages=\[  
            {"role": "system", "content": prompt},  
            {"role": "user", "content": printout},  
            {"role": "user", "content": state\['search\_failures'\]},  
        \],  
    )

递归代理

  • 检索 Router Agent 标记的节点的信息

  • 获取新的链接节点,或在文档上对页脚进行关键字搜索(例如,如果页脚要求引用没有链接的第 7.3 和 7.4 段,则改为进行搜索)。LLM 调用将在此步骤中删除冗余节点

def recursive\_retrieval(state: AgentState) -> AgentState:  
  
    current\_nodes = state\["last\_fetched\_context\_nodes"\]  
      
    for current\_node in current\_nodes:  
        state\["previous\_nodes"\].append(current\_node)  
  
    new\_current\_nodes = \[\]  
  
    \# look up the nodes to fetch by id      
      
    for node\_id in state\["node\_links\_to\_fetch"\]:  
    \# sometimes GPT returns node ids with or without backticks  
        if node\_id\[0\] == "\`":  
            node\_id = node\_id\[1:-1\]  
        if node\_id in local\_nodes\_map:  
            new\_current\_nodes.append(local\_nodes\_map\[node\_id\])  
        else:  
            state\["search\_failures"\].append(f"Failed to fetch node with id: {node\_id}")  
  
  
    for node\_id, search\_query in state\["node\_footers\_to\_fetch"\].items():  
        \# fetch nodes by keyword and bm25 search  
        footer\_retrieved\_nodes = retrieve\_with\_keywords\_bm25(search\_query)  
        \# LLM prunes nodes that are not relevant  
        footer\_retrieved\_nodes, \_ = prune\_nodes(search\_query, footer\_retrieved\_nodes)  
  
        for node in footer\_retrieved\_nodes:  
            new\_current\_nodes.append(node)  
  
        \# if no nodes fetched, log failure  
        if len(footer\_retrieved\_nodes) == 0:  
            state\["search\_failures"\].append(  
                f"Failed to fetch nodes for query: {search\_query}"  
            )  
  
    state\["last\_fetched\_context\_nodes"\] = new\_current\_nodes  
    state\["pass\_count"\] += 1  
    state\["node\_footers\_to\_fetch"\] = {}  
    state\["node\_links\_to\_fetch"\] = \[\]  
  
    return state

应答代理

  • 给定检索过程中收集的所有信息以及文档中的定义,它会最终确定查询的答案

  • 它还尝试尽可能链接到来源,例如段落编号

def answering\_agent(state: AgentState) -> AgentState:  
    \# answer the query  
    prompt = f"""  
You are an answering agent. You will be given a list of document nodes that were automatically retrieved by the system. These nodes are to answer the query:  
\`\`\`{state\['query'\]}\`\`\`  
  
Give references to sections/paragraphs if possible, but do not output full node ids with backticks and the hash.   
"""

通过 Multi-Graph Multi-Agent 系统检索的结果的变体

Answer #2:答案 #2:

To manage control functions effectively, both the Board and the Chief   
Compliance Officer (CCO) must collaborate and establish a structured   
framework. Key measures include:  
  
Board’s Responsibilities:  
\- The Board must approve the appointment, remuneration, and termination of the  
CCO, ensuring they have the necessary stature to engage effectively with  
senior management (S 6.3(a), (b)).  
\- The Board should engage regularly with the CCO to discuss compliance issues  
and ensure the CCO has direct access to the Board (S 6.3(c), (d)).  
\- The Board must also assure that the CCO is granted adequate resources and  
support, including competent officers, to fulfill their duties (S 6.3(e)).  
  
CCO’s Role and Independence:  
\- The CCO should oversee the institution-wide compliance risk management and   
ensure that responsibilities are clearly documented and communicated in the   
compliance policy (S 7.2(a), (b)).  
\- If the CCO is involved in other control functions, they must ensure their   
independence and ability to focus on compliance responsibilities remain   
uncompromised (S 7.3).  
  
Coordination with Other Functions:  
\- Proper coordination between the CCO and other control functions is essential.  
This includes robust information flows and mechanisms for seeking compliance  
advice (S 7.2(d)).  
\- The Board must approve the sharing of compliance responsibilities to ensure  
there is no dilution of focus or effectiveness (S 7.4(a)).  
  
Separation from Internal Audit:  
\- Compliance functions should remain distinct from the internal audit to   
maintain the efficacy of independent reviews (S 7.4(b), S 9.1).  
  
Training and Capacity Building:  
\- The compliance function is responsible for training and providing guidance  
to other officers on legal and regulatory requirements to manage compliance   
risk effectively (S 8.11).  
  
By implementing these steps, the Board and the CCO can effectively manage  
control functions, maintaining robust compliance and governance frameworks.

Answer #3:答案 #3:

The management of control functions by the Board and the Chief Compliance   
Officer (CCO) involves several key responsibilities and structures:  
  
Role of the Board in Managing CCO Functions:  
\- The board must approve the appointment, remuneration, and termination of the  
CCO (Section 6.3(a)).  
\- The board should ensure that the CCO has sufficient stature to interact   
effectively with the CEO and senior management (Section 6.3(b)).  
\- Regular engagement between the board and the CCO is important to discuss   
compliance issues directly (Section 6.3(c)).  
\- The CCO must have direct, unimpeded access to the board (Section 6.3(d)).  
\- There must be adequate resources and support for the CCO to perform his  
duties effectively (Section 6.3(e)).  
  
Shared Responsibilities and Independence:  
\- Where compliance functions are shared, the board must approve this   
arrangement, and responsibilities should be clearly defined and documented  
in the compliance policy (Section 7.2).  
\- The CCO should not assume responsibilities for internal audit, as this can  
compromise independent review processes (Sections 7.4, 9.1).  
\- The CCO must ensure that their independence and ability to focus on  
compliance are not impaired by additional responsibilities (Section 7.3).  
  
Responsibilities Within the Organization:  
\- Compliance is the responsibility of all officers within the institution.   
Business lines manage compliance risk through their managerial controls,   
while the compliance function ensures that these controls are adequate   
(Section 1.2).  
\- The internal audit function provides independent assurance on the quality   
and effectiveness of the institution’s controls, including those concerning  
compliance (Section 1.2(c)).  
  
Coordination Across Control Functions:  
\- Arrangements for coordination among control functions and the CCO must   
promote a consistent approach to managing compliance risk, with adequate   
information flows and avenues for advice (Section 7.2(d)).  
  
By following these guidelines, the Board and the CCO can manage the  
compliance control functions effectively, ensuring that compliance risks  
are appropriately identified, managed, and mitigated across the organization.

如何学习大模型 AI ?

由于新岗位的生产效率,要优于被取代岗位的生产效率,所以实际上整个社会的生产效率是提升的。

但是具体到个人,只能说是:

“最先掌握AI的人,将会比较晚掌握AI的人有竞争优势”。

这句话,放在计算机、互联网、移动互联网的开局时期,都是一样的道理。

我在一线互联网企业工作十余年里,指导过不少同行后辈。帮助很多人得到了学习和成长。

我意识到有很多经验和知识值得分享给大家,也可以通过我们的能力和经验解答大家在人工智能学习中的很多困惑,所以在工作繁忙的情况下还是坚持各种整理和分享。但苦于知识传播途径有限,很多互联网行业朋友无法获得正确的资料得到学习提升,故此将并将重要的AI大模型资料包括AI大模型入门学习思维导图、精品AI大模型学习书籍手册、视频教程、实战学习等录播视频免费分享出来。

在这里插入图片描述

第一阶段(10天):初阶应用

该阶段让大家对大模型 AI有一个最前沿的认识,对大模型 AI 的理解超过 95% 的人,可以在相关讨论时发表高级、不跟风、又接地气的见解,别人只会和 AI 聊天,而你能调教 AI,并能用代码将大模型和业务衔接。

  • 大模型 AI 能干什么?
  • 大模型是怎样获得「智能」的?
  • 用好 AI 的核心心法
  • 大模型应用业务架构
  • 大模型应用技术架构
  • 代码示例:向 GPT-3.5 灌入新知识
  • 提示工程的意义和核心思想
  • Prompt 典型构成
  • 指令调优方法论
  • 思维链和思维树
  • Prompt 攻击和防范

第二阶段(30天):高阶应用

该阶段我们正式进入大模型 AI 进阶实战学习,学会构造私有知识库,扩展 AI 的能力。快速开发一个完整的基于 agent 对话机器人。掌握功能最强的大模型开发框架,抓住最新的技术进展,适合 Python 和 JavaScript 程序员。

  • 为什么要做 RAG
  • 搭建一个简单的 ChatPDF
  • 检索的基础概念
  • 什么是向量表示(Embeddings)
  • 向量数据库与向量检索
  • 基于向量检索的 RAG
  • 搭建 RAG 系统的扩展知识
  • 混合检索与 RAG-Fusion 简介
  • 向量模型本地部署

第三阶段(30天):模型训练

恭喜你,如果学到这里,你基本可以找到一份大模型 AI相关的工作,自己也能训练 GPT 了!通过微调,训练自己的垂直大模型,能独立训练开源多模态大模型,掌握更多技术方案。

到此为止,大概2个月的时间。你已经成为了一名“AI小子”。那么你还想往下探索吗?

  • 为什么要做 RAG
  • 什么是模型
  • 什么是模型训练
  • 求解器 & 损失函数简介
  • 小实验2:手写一个简单的神经网络并训练它
  • 什么是训练/预训练/微调/轻量化微调
  • Transformer结构简介
  • 轻量化微调
  • 实验数据集的构建

第四阶段(20天):商业闭环

对全球大模型从性能、吞吐量、成本等方面有一定的认知,可以在云端和本地等多种环境下部署大模型,找到适合自己的项目/创业方向,做一名被 AI 武装的产品经理。

  • 硬件选型
  • 带你了解全球大模型
  • 使用国产大模型服务
  • 搭建 OpenAI 代理
  • 热身:基于阿里云 PAI 部署 Stable Diffusion
  • 在本地计算机运行大模型
  • 大模型的私有化部署
  • 基于 vLLM 部署大模型
  • 案例:如何优雅地在阿里云私有部署开源大模型
  • 部署一套开源 LLM 项目
  • 内容安全
  • 互联网信息服务算法备案

学习是一个过程,只要学习就会有挑战。天道酬勤,你越努力,就会成为越优秀的自己。

如果你能在15天内完成所有的任务,那你堪称天才。然而,如果你能完成 60-70% 的内容,你就已经开始具备成为一名大模型 AI 的正确特征了。

这份完整版的大模型 AI 学习资料已经上传CSDN,朋友们如果需要可以微信扫描下方CSDN官方认证二维码免费领取【保证100%免费

在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值