Large Language Model. • An LLM is a language model based on artificial neural networks, trained on vast amounts of text data. • There are limitations in inferring the latest data to produce results. Various methods are being developed to overcome this. • LLMs are slightly different from search engines (LLMs were more often preferred for tasks requiring nuanced understanding and language processing.) • Examples of usage: ◦ Chatbots: Can answer questions and engage in conversations. ◦ Text summarization: Can summarize long documents into shorter versions. ◦ Translation: Can translate from one language to another. ◦ Writing: Can perform creative writing and code generation.
on ChatGPT and Beyond The evolutionary tree of modern LLMs traces the development of language models in recent years and highlights some of the most well-known models. Models on the same branch have closer relationships. Transformer-based models are shown in non-grey colors: decoder-only models in the blue branch, encoder-only models in the pink branch, and encoder-decoder models in the green branch. The vertical position of the models on the timeline represents their release dates. Open-source models are represented by solid squares, while closed-source models are represented by hollow ones. The stacked bar plot in the bottom right corner shows the number of models from various companies and institutions. Overview The evolutionary tree of modern LLMs 8
training data may not cover all possible knowledge areas comprehensively, leading the model to fill gaps with fabricated information. • Model Training: When an AI model becomes overfitted, it generates outputs that are highly specific to the training data and do not generalize well to new data. This can lead to hallucinations or the production of irrelevant outputs by the AI model. + training data bias/inaccuracy and high model complexity. • Prompt Ambiguity: Ambiguous or poorly phrased prompts can lead the model to generate responses that diverge from factual accuracy. Overview LLM Hallucination
software architecture and technique that integrates large language models with external information sources, enhancing the accuracy and reliability of generative AI models by incorporating specific business data like documents, SQL databases, and internal applications. @source: Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks
2 3 4 1 Split Split the loaded document into chunk units Load Read data from documents (pdf, word, xlsx), web pages, Notion, Confluence, etc. Embedding Convert a document to a vector representation Vector Store Save the converted vector in DB 20
developing applications powered by large language models (LLMs). a. Open-source libraries: Build your applications using LangChain's modular building blocks and components. b. Productionization: Inspect, monitor, and evaluate your apps with LangSmith so that you can constantly optimize and deploy with confidence. c. Deployment: Turn any chain into a REST API with LangServe.
creating a new tech stack in its wake. However, emerging libraries and tools are predominantly being developed for the Python and JavaScript ecosystems. As a result, the number of applications leveraging LLMs in these ecosystems has grown exponentially. • In contrast, the Dart / Flutter ecosystem has not experienced similar growth, which can likely be attributed to the scarcity of Dart and Flutter libraries that streamline the complexities associated with working with LLMs. • LangChain.dart aims to fill this gap by abstracting the intricacies of working with LLMs in Dart and Flutter, enabling developers to harness their combined potential effectively. @source: https://github.com/davidmigloz/langchain_dart
you can create an LLM app (client) using only the Dart language. • The official documentation is well-organized and easy to use. ◦ https://langchaindart.de v/#/ Cons • Currently, the number of supported third-party libraries is limited. 28
based on only the following " "context:\n{context}\n{question}"); final chatPromptTemplate = ChatPromptTemplate.fromTemplates( const [ ( ChatMessageType.system, 'Answer the question based on only the following context:\n{context}' ), (ChatMessageType.human, "\n{question}"), ], ); Prompt is an art
based on only the following " "context:\n{context}\n{question}"); final chatPromptTemplate = ChatPromptTemplate.fromTemplates( const [ ( ChatMessageType.system, 'Answer the question based on only the following context:\n{context}' ), (ChatMessageType.human, "\n{question}"), ], ); Retrievers Search Result User Query
chain = setupAndRetrieval.pipe(promptTemplate).pipe(llm).pipe(outputParser); final result = chain.stream(text); await for (var text in result) { setState(() { resultText += text; }); }
chain = setupAndRetrieval.pipe(promptTemplate).pipe(llm).pipe(outputParser); final result = chain.stream(text); await for (var text in result) { setState(() { resultText += text; }); } User Query Output
phenomenon in LLMs and to obtain accurate answers for personal data and updated information. • Recent LLM services handle responses for the latest data by performing web searches in advance (Agent). • LangChain and LlamaIndex frameworks are mainly used for developing LLM apps. • LangChain is implemented in Python and JavaScript. • By using the LangChain Dart package, LLM app development can be done easily and quickly. • We learned how to implement it based on the basic 8 steps of RAG with dart . Summary Implementing a RAG System with Dart language 49