Exploring the Potential of ChatGPT-like AI in Internal Audit(8)--LangChain

Exploring the Potential of ChatGPT-like AI in Internal Audit(8)--LangChain

Although this is a highly technical post, I cannot resist sharing my understanding of LangChain's value with the internal audit community. LangChain?is a framework for developing applications powered by language models, it has implemented a lot abstractions for working with language models, in short, very complicated tasks could be implemented in 20+ lines of code with LangChain.

While I have discussed ChatGPT's common applications, such as summarization, translation, and data analytics, which may be useful for internal audit, I believe that most pioneers have realized ChatGPT's capabilities are often limited by token, trained data, and relevance limits. After immersing myself in the coding community, I have identified one of the most convenient coding packages available so far—LangChain.

When I started to write this article, DeepLearningAI published two new short courses LangChain for LLM Application Development and LangChain: Chat with Your Data, which delayed this article's writing. Both courses are highly recommended for anyone interested in this topic, regardless of programming knowledge, as they provide a better understanding of the technology boundary.

LangChain fascinates me primarily in three areas:

  1. Beyond Token Limits

I will use summarization as an example. The basic idea is to split your long text into multiple pieces, which will then be fed to LLMs for further processing. The tricky part involves not only choosing the right length of each piece, but also determining how much overlap to use and how to pass each piece to LLMs. However, LangChain has packaged all these details as parameters at your disposal and provided at least three ways to exceed the intrinsic token limit of LLMs.

(1) Map Reduce

No alt text provided for this image
Taken from https://shweta-lodha.medium.com/how-to-deal-with-openai-token-limit-issue-part-1-d0157c9e4d4e

Split the long text into smaller, equal-sized chunks and pass them to LLMs for summary. Use LLMs to summarize all chunk-summaries to get the final summary.

(2) Refine

No alt text provided for this image
Taken from https://shweta-lodha.medium.com/how-to-deal-with-openai-token-limit-issue-part-1-d0157c9e4d4e

The splitting process remains the same, but the final summary is generated using the previous summary and the data from the next chunk.

(3) Map_rerank

No alt text provided for this image
Taken from https://learn.deeplearning.ai/langchain-chat-with-your-data/

After splitting a task into chunks, an initial prompt is run on each chunk. The prompt not only attempts to complete the task, but also provides a score indicating its confidence in the answer. The response with the highest score is returned.

2.Chat with your data

While some ChatGPT plugins and some GPT-API based applications have implemented this functionality, primarily for PDF files, LangChain supports a much wider range of data types and provides better data privacy.

No alt text provided for this image
Taken from https://python.langchain.com/docs/use_cases/question_answering/

To implement this functionality, LangChain offers a complete solution that includes document loading, splitting, vector database and retrieval(using the same technology that search engines use). Only relevant chunks of data are passed to LLMs as context for specific tasks.

No alt text provided for this image
Taken from https://python.langchain.com/docs/use_cases/question_answering/

Throughout this process, most data is stored locally. APIs for cloud-based AI, such as Open AI and Claude, only retain data for misuse and abuse monitoring for a short time. LLMs can easily switch to less powerful but locally distributable ones. In the extreme case, highly confidential information can be processed completely offline.


3.Agent

The concept of building agents with LLM (large language model) as its core controller is fascinating. Several proof-of-concept demos, such as AutoGPT, GPT-Engineer, and BabyAGI, serve as inspiring examples. The potential of LLM extends beyond generating well-written copies, stories, essays, and programs; it can also be framed as a powerful general problem solver. If designed properly, it would certainly be able to accomplish some standardized audit programs, which will greatly enhance internal auditors’ overall productivity.

LangChain provides agent interface that has access to a suite of tools, and determines which ones to use depending on the user input. Agents can use multiple tools, and use the output of one tool as the input to the next. In short, LangChain’s advantage is to allow user to easily swap tools out for different options.

As I stated at the beginning, the primary audience for this article may not be "traditional" internal auditors, even though I have made an effort to avoid mentioning programming details. Nonetheless, since ChatGPT-like AIs can complete much of the standardized work of these "traditional" auditors quickly, it wouldn't hurt for those who are willing to be non-traditional to consider exploring this avenue.

要查看或添加评论,请登录

Kaining Deng的更多文章

  • Auditors in the everything+AI era: Are we ready?

    Auditors in the everything+AI era: Are we ready?

    China's AI surprise: Kimi.ai emerges as a powerful contender A recent development in China's AI landscape has surprised…

  • What I learned from ISACA Digital Trust World Dublin

    What I learned from ISACA Digital Trust World Dublin

    The ISACA Digital Trust World in Dublin was a vibrant centre for stimulating debates, revelations, and teachings about…

  • 为什么ChatGPT对隐私不安全?

    为什么ChatGPT对隐私不安全?

    注:这些文章原本都是用英文写的,突然想到其实中文世界可能更需要,所以一时兴起用GPT-4给翻译成中文,对于语法等都是以英语为背景进行解释的,全文翻译准确性由GPT-4全权负责。…

  • 针对AI生成内容的数字身份框架需求

    针对AI生成内容的数字身份框架需求

    注:这些文章原本都是用英文写的,突然想到其实中文世界可能更需要,所以一时兴起用GPT-4给翻译成中文,对于语法等都是以英语为背景进行解释的,全文翻译准确性由GPT-4全权负责。…

  • 探讨类似ChatGPT人工智能在内部审计中的潜力(7)--最伟大的导师

    探讨类似ChatGPT人工智能在内部审计中的潜力(7)--最伟大的导师

    注:这些文章原本都是用英文写的,突然想到其实中文世界可能更需要,所以一时兴起用GPT-4给翻译成中文,对于语法等都是以英语为背景进行解释的,全文翻译准确性由GPT-4全权负责。…

  • 探讨类似ChatGPT人工智能在内部审计中的潜力(6)--工作消灭与创造

    探讨类似ChatGPT人工智能在内部审计中的潜力(6)--工作消灭与创造

    注:这些文章原本都是用英文写的,突然想到其实中文世界可能更需要,所以一时兴起用GPT-4给翻译成中文,对于语法等都是以英语为背景进行解释的,全文翻译准确性由GPT-4全权负责。…

  • 探讨类似ChatGPT人工智能在内部审计中的潜力(5)--风险

    探讨类似ChatGPT人工智能在内部审计中的潜力(5)--风险

    注:这些文章原本都是用英文写的,突然想到其实中文世界可能更需要,所以一时兴起用GPT-4给翻译成中文,对于语法等都是以英语为背景进行解释的,全文翻译准确性由GPT-4全权负责。…

  • 探讨类似ChatGPT人工智能在内部审计中的潜力(4)--写作

    探讨类似ChatGPT人工智能在内部审计中的潜力(4)--写作

    注:这些文章原本都是用英文写的,突然想到其实中文世界可能更需要,所以一时兴起用GPT-4给翻译成中文,对于语法等都是以英语为背景进行解释的,全文翻译准确性由GPT-4全权负责。…

  • 探讨类似ChatGPT人工智能在内部审计中的潜力(3)--数据分析

    探讨类似ChatGPT人工智能在内部审计中的潜力(3)--数据分析

    注:这些文章原本都是用英文写的,突然想到其实中文世界可能更需要,所以一时兴起用GPT-4给翻译成中文,对于语法等都是以英语为背景进行解释的,全文翻译准确性由GPT-4全权负责。…

  • 探讨类似ChatGPT人工智能在内部审计中的潜力(2)--总结

    探讨类似ChatGPT人工智能在内部审计中的潜力(2)--总结

    注:这些文章原本都是用英文写的,突然想到其实中文世界可能更需要,所以一时兴起用GPT-4给翻译成中文,对于语法等都是以英语为背景进行解释的,全文翻译准确性由GPT-4全权负责。…

社区洞察

其他会员也浏览了