LLM 애플리케이션 아키텍처를 활용한 생성형 AI 서비스 구현: RAG모델과 LangChain 프레임워크 기반 Generative AI service implementation using LLM application architecture: based on RAG model and LangChain framework원문보기
최근 생성형 AI 기술의 발전으로 인해 대형 언어 모델(Large Language Model, LLM)의 활용 및 도입이 확대되고 있는 상황에서 기존 연구들은 기업내부 데이터의 활용에 대한 실제 적용사례나 구현방법을 찾아보기 힘들다. 이에 따라 본 연구에서는 가장 많이 이용되고 있는 LangChain 프레임워크를 이용한 LLM 애플리케이션 아키텍처를 활용하여 생성형 AI 서비스를 구현하는 방법을 제시한다. 이를 위해 LLM의 활용을 중심으로, 정보 부족 문제를 극복하는 다양한 방법을 검토하고 구체적인 해결책을 제시하였다. 이를 위해 파인튜닝이나 직접 문서 정보를 활용하는 방법을 분석하며, 이러한 문제를 해결하기 위한 RAG 모델을 활용한 정보 저장 및 검색 방법에 대해 주요단계에 대해 자세하게 살펴본다. 특히, RAG 모델을 활용하여 정보를 벡터저장소에 저장하고 검색하기 위한 방법으로 유사문맥 추천 및 QA시스템을 활용하였다. 또한 구체적인 작동 방식과 주요한 구현 단계 및 사례를 구현소스 및 사용자 인터페이스까지 제시하여 생성형 AI 기술에 대한 이해를 높였다. 이를 통해 LLM을 활용한 기업내 서비스 구현에 적극적으로 활용할 수 있도록 하는데 의미와 가치가 있다.
최근 생성형 AI 기술의 발전으로 인해 대형 언어 모델(Large Language Model, LLM)의 활용 및 도입이 확대되고 있는 상황에서 기존 연구들은 기업내부 데이터의 활용에 대한 실제 적용사례나 구현방법을 찾아보기 힘들다. 이에 따라 본 연구에서는 가장 많이 이용되고 있는 LangChain 프레임워크를 이용한 LLM 애플리케이션 아키텍처를 활용하여 생성형 AI 서비스를 구현하는 방법을 제시한다. 이를 위해 LLM의 활용을 중심으로, 정보 부족 문제를 극복하는 다양한 방법을 검토하고 구체적인 해결책을 제시하였다. 이를 위해 파인튜닝이나 직접 문서 정보를 활용하는 방법을 분석하며, 이러한 문제를 해결하기 위한 RAG 모델을 활용한 정보 저장 및 검색 방법에 대해 주요단계에 대해 자세하게 살펴본다. 특히, RAG 모델을 활용하여 정보를 벡터저장소에 저장하고 검색하기 위한 방법으로 유사문맥 추천 및 QA시스템을 활용하였다. 또한 구체적인 작동 방식과 주요한 구현 단계 및 사례를 구현소스 및 사용자 인터페이스까지 제시하여 생성형 AI 기술에 대한 이해를 높였다. 이를 통해 LLM을 활용한 기업내 서비스 구현에 적극적으로 활용할 수 있도록 하는데 의미와 가치가 있다.
In a situation where the use and introduction of Large Language Models (LLMs) is expanding due to recent developments in generative AI technology, it is difficult to find actual application cases or implementation methods for the use of internal company data in existing studies. Accordingly, this st...
In a situation where the use and introduction of Large Language Models (LLMs) is expanding due to recent developments in generative AI technology, it is difficult to find actual application cases or implementation methods for the use of internal company data in existing studies. Accordingly, this study presents a method of implementing generative AI services using the LLM application architecture using the most widely used LangChain framework. To this end, we reviewed various ways to overcome the problem of lack of information, focusing on the use of LLM, and presented specific solutions. To this end, we analyze methods of fine-tuning or direct use of document information and look in detail at the main steps of information storage and retrieval methods using the retrieval augmented generation (RAG) model to solve these problems. In particular, similar context recommendation and Question-Answering (QA) systems were utilized as a method to store and search information in a vector store using the RAG model. In addition, the specific operation method, major implementation steps and cases, including implementation source and user interface were presented to enhance understanding of generative AI technology. This has meaning and value in enabling LLM to be actively utilized in implementing services within companies.
In a situation where the use and introduction of Large Language Models (LLMs) is expanding due to recent developments in generative AI technology, it is difficult to find actual application cases or implementation methods for the use of internal company data in existing studies. Accordingly, this study presents a method of implementing generative AI services using the LLM application architecture using the most widely used LangChain framework. To this end, we reviewed various ways to overcome the problem of lack of information, focusing on the use of LLM, and presented specific solutions. To this end, we analyze methods of fine-tuning or direct use of document information and look in detail at the main steps of information storage and retrieval methods using the retrieval augmented generation (RAG) model to solve these problems. In particular, similar context recommendation and Question-Answering (QA) systems were utilized as a method to store and search information in a vector store using the RAG model. In addition, the specific operation method, major implementation steps and cases, including implementation source and user interface were presented to enhance understanding of generative AI technology. This has meaning and value in enabling LLM to be actively utilized in implementing services within companies.
정천수. (2023c). 전통적인 챗봇과 ChatGPT 연계?서비스 방안 연구, 한국정보기술응용학회지,?3(4), 11-28. https://doi.org/10.21219/jitam.2023.30.4.001?
조정임. (2023). 초거대 AI와 생성형 인공지능, TTA?저널, 제207호.?
최성철. (2023). 기업을 위한 ChatGPT, 프라이빗 챗GPT!, SAMSUNG SDS 인사이트 리포트.?
한국정보화진흥원. (2016). 인공지능 기반의 '챗봇(Chat-Bot)' 서비스 등장과 발전 동향, ICT?융합의Issues & Trends, 2016-8월호.?
홍기주, 김한준, 전종훈. (2016). 텐서공간모델 기반?시멘틱 검색 기법, 한국전자거래학회지, 21(4),?1-14.?
Andreessen Horowitz. (2023, January 19). Who Owns?the Generative AI Platform?. https://a16z.com/2023/01/19/who-owns-the-generative-ai-platform/
Arefeen, A., Debnath, B., Chakradhar, S. (2023,?September 2). LeanContext: Cost-Efficient Domain-Specific Question Answering Using LLMs.?arXiv preprint arXiv:2309.00841.?
Bommasani, R., et. al. (2021, August 16). On the?Opportunities and Risks of Foundation Models.?arXiv preprint arXiv:2108.07258.?
Chowdhery, A., et., al. (2022). Palm: Scaling language?modeling with pathways. CoRR, vol. abs/2204.02311?
Devtorium. (2023, July 26). How Vector Databases?Can Enhance Custom AI Solutions. https://devtorium.com/blog/how-vector-databases-can-enhance-custom-ai-solutions/
Dilmegani, C. (2023, June 21). Large Language?Models: Complete Guide in 2023. https://research.aimultiple.com/large-language-models/
Gartner. (2023, August 23). What's New in the 2023?Gartner Hype Cycle for Emerging Technologies.?https://www.gartner.com/en/articles/what-s-new-in-the-2023-gartner-hype-cycle-for-emerging-technologies
Greyling, C. (2023, October 21). Large Language?Model (LLM) Disruption of Chatbots. https://cobusgreyling.medium.com/large-language-model-llm-disruption-of-chatbots-8115fffadc22
Huyen, C. (2023, April 21). Building LLM applications?for production. https://huyenchip.com/2023/04/11/llm-engineering.html.?
IDC. (2023, May). Generative AI Platforms and?Applications Market Trends and Forecast 2Q23.?
Jeong, C. S. (2023, September 03). A Study on the?Implementation of Generative AI Services Using?an Enterprise Data-Based LLM Application?Architecture. arXiv preprint arXiv:2309.01105.?
Jeong, J. H. and Jeong, C. S. (2022). Ethical?Issues with Artificial Intelligence (A Case?Study on AI Chatbot & Self-Driving Car), International Journal of Scientific & Engineering?Research, 13(1). 468-471.?
LangChain. (2023, October 28). LangChain Introduction.?https://python.langchain.com/docs/get_started/introduction?
Mayank, S. (2023, June 30). Generative AI: Empowering?Innovation with its Astonishing Capabilities.?https://shurutech.com/innovating-with-generative-ai/
Microsoft. (2023, August 01). Retrieval Augmented?Generation using Azure Machine Learning prompt?flow. https://learn.microsoft.com/en-us/azure/machine-learning/concept-retrieval-augmentedgeneration?viewazureml-api-2?
Nijkamp, E., et., al. (2022). Codegen: An open large?language model for code with mtulti-turn program?synthesis. arXiv preprint arXiv:2203.13474.?
Raschka, S. (2023, May 20). Finetuning LLMs Efficiently?with Adapters. https://magazine.sebastianraschka.com/p/finetuning-llms-with-adapters?
RevFactory. (2023, August 23). RevFactory Project -?OpenAI enables GPT-3.5 fine tuning starting today. https://revf.tistory.com/293?
Sanchez-Diaz, X., Ayala-Bastidas, G., Fonseca-Ortiz,?P., Garrido, L. (2018). A Knowledge-Based?Methodology for Building a Conversational?Chatbot as an Intelligent Tutor, Advances in?Computational Intelligence, Vol. 11289. 165-175.?https://doi.org/10.1007/978-3-030-04497-8_14?
Sivarajkumar, S., Kelley, M., Samolyk-Mazzanti, A.,?Visweswaran, S., Wang, Y. (2023, September?18). An Empirical Evaluation of Prompting?Strategies for Large Language Models in?Zero-Shot Clinical Natural Language Processing.?arXiv preprint arXiv:2309.08008.?
Taylor, R., et., al. (2022). On the Opportunities?and Risks of Foundation Models. CoRR, vol.?abs/2211.09085?
Zhao, W. X., et al. (2023, June 29). A Survey of Large?Language Models. arXiv preprint arXiv:2303.18223.?
※ AI-Helper는 부적절한 답변을 할 수 있습니다.