오픈AI는 챗GPT(ChatGPT)의 주간 활성 사용자가 2억 명을 돌파했다고 밝혔다. 이는 지난해보다 두 배 증가한 수준이다.
39일 악시오스에 따르면, 포춘 500대 기업 중 92%가 오픈AI 제품을 사용하고 있다. 또 GPT-4o 미니(mini)가 올 7월에 출시된 이후 자동화 API 사용량이 두 배 증가했다.
샘 올트먼 오픈AI 최고경영책임자(CEO)는 “사람들이 우리의 도구를 이제 일상적으로 사용하고 있으며, 이는 의료 및 교육과 같은 분야에서 실질적인 변화를 가져오고 있다”며 “일상적인 업무 지원부터 어려운 문제 해결, 창의성 발현까지 다양한 영역에서 도움을 주고 있다”고 말했다.
오픈AI는 생성형 AI 챗봇 시장에서 선두 자리를 유지하고 있다. 하지만 테크 기업들이 점유율을 높이고자, 서비스를 업데이트하면서 경쟁 격화에 노출된 상태다.
이날 메타(Meta)는 오픈 소스 라마(Llama) 모델의 도입이 급격히 증가했다고 밝혔다. 라마(Llama) 3.1 출시 이후 올해 5월과 7월 사이 주요 클라우드 서비스 제공업체에서의 사용량이 두 배 증가했다는 것이 회사측 설명이다.
월가는 특정 종류의 승자를 선호한다. 이는 단기 수익과 영업 이익이 추정치를 뛰어넘는, 최상의 분기별 재무 보고서를 발표할 수 있는 승자를 의미한다.
월가는 장기적인 관점, 특히 초장기적인 관점에는 거의 신경 쓰지 않는 듯하다. 기업 경영진이 몇 년 후 급성장할 기술을 지배하기 위해 신중하게 장기 계획을 세울 때보다 분기별 실적이 급상승할 때 주가가 급등할 가능성은 훨씬 더 높다.
이것이 7월 말 마이크로소프트의 실적 발표에 대한 주식 시장의 반응이 주는 교훈이다. 투자자들에게 중요한 소식은 무엇이었을까? 마이크로소프트의 클라우드 기반 애저(Azure) 비즈니스가 해당 분기에 “단지” 30% 성장해 회사가 예상했던 31%보다 1% 낮았다는 점이다.
다음 날 트레이더들은 마이크로소프트를 ‘처벌’했다. 전체 시장이 상승세(예를 들어 S&P 지수는 86% 증가)인 와중에 회사의 주가는 4% 이상 하락했다. 이는 마이크로소프트가분기 매출 15%, 순이익 10%가 증가했다고 발표한 뒤에 일어난 일이다.
마이크로소프트의 AI 장기 투자에 무심한 월가 실적 발표에서 나온 훨씬 더 중요한 소식은 마이크로소프트가 AI에 올인하고 있으며 수년간 수익을 내지 못할 수도 있는 장기 인프라에 막대한 비용을 지출하고 있다는 점이었다. 하지만 주가를 기준으로 볼 때 이 소식이 월가에서는 중요하지 않은 것처럼 보였다.
마이크로소프트 CFO인 에이미 후드는 애널리스트들과의 통화에서 190억 달러의 자본 지출이 거의 모두 AI 및 클라우드와 관련이 있다고 말했다. 지출의 절반은 인프라 관련 비용, 특히 AI용 대규모 컴퓨팅 성능에 필요한 데이터센터를 구축하는 데 사용됐다. 이는 AI 붐이 본격화되기 전인 2년 전보다 2배 이상 증가한 수치다.
이에 대해뉴욕타임스는 “수익 보고서는 마이크로소프트가 데이터센터를 구축하고 AI 기술을 구동하는 고가의 칩을 구입하는 데 막대한 비용을 지출하고 있음을 보여준다. 회사의 자본 지출은 나델라가 최고 경영진에게 AI 투자를독려한 2022년 말부터 매 분기 증가했다”라고 설명했다.
이 정도의 지출 규모는 마이크로소프트가 AI 시장을 계속 장악하고 향후 수십억 달러의 수익을 거두기 위해 반드시 필요할 터지만 월가를 성가시게 했다. 특히 후드가 대규모 지출이 “향후 15년과 그 이후에도 수익 창출을 지원할 것”이라고 설명했을 때 투자자들을 겁을 먹었을 가능성이 높다.
월가에서 15년은 15억 년처럼 느껴질 수 있으며, 이들은 향후 10년 후의 ‘먼 미래’가 아니라 지금 당장, 그리고 단기적인 성과를 원한다.
마이크로소프트의 대대적인 AI 베팅은 옳은 선택일까? 금융 시장이 수년간 수익을 내지 못할 기술에 거액을 투자하는 기업을 경계하는 데에는 그만한 이유가 있다. 기술은 빠르게 변하고, 기업이 ‘넥스트 빅 씽’을 추구하는 과정에는 변덕이 있을 수 있다. 오늘 확실한 기회처럼 보이는 것이 내일은 실패로 바뀔 수 있다. 가상 현실에 대한 과대 광고만 봐도 알 수 있다. 가상 현실에 대한 성과는 그 어느 때보다 찾기 어렵고 어쩌면 영원히 오지 않을 가능성도 있다.
하지만 AI에서는 그런 일이 일어나진 않을 것이다. 베팅이 클수록 더 큰 보상을 얻을 가능성이 높다. 가상 현실은 실제로 큰 수익을 창출한 적이 없지만, AI는 이미 그랬다. 게다가 아직 초기 단계다.
실제로 지난 분기에 마이크로소프트의 수익은 AI 서비스에 대한 수요를 따라잡지 못해 타격을 입었다. CEO 사티아 나델라와 후드는 실적 발표에서 데이터센터에 공급 역량이 충분했다면 해당 분기에 더 많은 AI 서비스를 판매할 수 있었을 것이라고 말했다.
마이크로소프트의 투자자 관계 책임자인 브렛 아이버슨은 뉴욕타임스에 “용량이 확보되는 즉시 판매되고 있다”라고 밝혔다.
캐나다 알버타대 연구진이 최근‘인공 신경망’의 한계를 극복하는 방안을 제안하는 논문을 네이처에 발표했습니다. 연구 결과보다 논문에서 정리한 인공 신경망의 한계 부분이 더 눈길을 끌었는데요, 이를 짧게 정리해 보겠습니다.
‘신경망’이라는 단어 들어보셨죠? 인간의 두뇌에서 영감을 얻은 일종의 시스템인데요, LLM이 이러한 신경망을 기반으로 구축됐습니다. 신경망은 마치 뇌의 ‘뉴런’이 연결된 것처럼 입력된 데이터를 여러 단계를 거쳐 가중치를 기반으로 답을 내놓는 방식입니다. 뉴런 간의 연결이 탄탄하고 많을수록 뇌 기능이 뛰어나다고 하듯이, 신경망 또한 마찬가지입니다.
신경망에는 입력과 출력 사이에 ‘은닉층’이라는 것이 있는데요, 이곳에서 많은 데이터를 학습하고 계산을 열심히 할수록 좋은 데이터가 나옵니다. 물론 이는 단순화한 설명입니다. 너무 많은 정보를 한 번에 공부하면 뇌에 과부하가 오듯이 은닉층을 늘리기만 하면 오히려 계산이 느려질 수 있다고 해요.
신경망, 정확히 얘기하면 인공 신경망은 이후 머신러닝 분야에서 활발히 적용되고 있습니다. 신경망이 가진 한계도 있습니다. 뇌를 본떴다고는 하지만 생물학적인 뇌와 기계적인 신경망이 같을 리 없는데요, 특히 지속 학습 과정에서 신경망이 가진 단점이 보고되고 있어요.
인간은 이전에 습득한 정보, 지식을 지우지 않고도 새로운 정보에 효과적으로 적응하고 대응할 수 있습니다. 생물체의 신경망은 과거의 데이터를 기억하는 능력, 즉 ‘안정성’과 새로운 개념을 학습하는 능력, ‘가소성’ 사이에서 균형을 찾으면서 학습해 갑니다.
알버타대학연구진의 비유를 볼게요. ‘퐁(Pong)’이라 불리는 비디오게임이 있습니다. 마치 탁구를 하듯 양쪽에서 공을 주고받는 게임인데요, 퐁에서 좋은 성적을 내도록 신경망을 학습시킨 뒤 비행기 게임 ‘갤러그’를 학습시키면 퐁에서의 점수가 크게 하락합니다. 새롭게 학습하는 게임이 많아질수록 처음 학습한 게임 방법을 거의 잃어버리게 됩니다.
Each ML/AI project stakeholder requires specialized tools that efficiently enable them to manage the various stages of an ML/AI project, from data preparation and model development to deployment and monitoring. They tend to use specialized open source tools because oftheir contribution as a significant catalyst to the advancement, development, and ease of AI projects. As a result, numerous open source AI tools have emerged over the years, making it challenging to pick from the available options.
This article highlights some factors to consider when picking open source tools and introduces you to 25 open-source options that you can use for your AI project.
Picking open source tools for AI project
The open source tooling model has allowed companies to develop diverse ML tools to help you handle particular problems in an AI project. The AI tooling landscape is already quite saturated with tools, and the abundance of options makes tool selection difficult. Some of these tools even provide similar solutions. You may be tempted to lean toward adopting tools just because of the enticing features they present. However, there are other crucial factors that you should consider before selecting a tool, which include:
Popularity
Impact
Innovation
Community engagement
Relevance to emerging AI trends.
Popularity
Widely adopted tools often indicate active development, regular updates, and strong community support, ensuring reliability and longevity.
Impact
A tool with a track record of addressing pain points, delivering measurable improvements, providing long-term project sustainability, and adapting to evolving needs of the problems of an AI project is a good measure of an impactful tool that stakeholders are interested in leveraging.
Innovation
Tools that embrace more modern technologies and offer unique features demonstrate a commitment to continuous improvement and have the potential to drive advancements and unlock new possibilities.
Community engagement
Active community engagement fosters collaboration, provides support, and ensures a tool's continued relevance and improvement.
Relevance to emerging AI trends
Tools aligned with emerging trends like LLMs enable organizations to leverage the latest capabilities, ensuring their projects remain at the forefront of innovation.
25 open source tools for your AI project
Based on these factors, here are 25 tools that you and the different stakeholders on your team can use for various stages in your AI project.
1. KitOps
Multiple stakeholders are involved in the machine learning development lifecycle which requires different MLOps tools and environments at various stages of the AI project., which makes it hard to guarantee an organized, portable, transparent, and secure model development pipeline.
This introduces opportunities for model lineage breaks and accidental or malicious model tampering or modifications during model development. Since the contents of a model are a "black box”—without efficient storage and lineage—it is impossible to know if a model's or model artifact's content has been tampered with between model development, staging, deployment, and retirement pipelines.
KitOpsprovides AI project stakeholders with a secure package called ModelKit that they can use to share and manage models, code, metadata, and artifacts throughout the ML development lifecycle.
The ModelKit is an immutable OCI-standard artifact that leverages normal container-native technologies (similar to Docker and Kubernetes), making them seamlessly interoperable and portable across various stakeholders using common software tools and environments. As an immutable package, ModelKit is tamper-proof. This tamper-proof property provides stakeholders with a versioning system that tracks every single update to any of its content (i.e., models, code, metadata, and artifacts) throughout the ML development and deployment pipelines.
2. LangChain
LangChainis a machine learning framework that enables ML engineers and software developers to build end-to-end LLM applications quickly. Its modular architecture allows them to easily mix and match itsextensive suite of componentsto create custom LLM applications.
LangChain simplifies the LLM application's development and deployment stages with its ecosystem of interconnected parts, consisting ofLangSmith,LangServe, andLangGraph. Together, they enable ML engineers and software developers to build robust, diverse, and scaleable LLM applications efficiently.
LangChain enables professionals without a strong AI background to easily build an application with large language models (LLMs).
3. Pachyderm
Pachydermis a data versioning and management platform that enables engineers to automate complex data transformations. It uses a data infrastructure that provides data lineage via a data-driven versioning pipeline. The version-controlled pipelines are automatically triggered based on changes in the data. It tracks every modification to the data, making it simple to duplicate previous results and test with various pipeline versions.
Pachyderm's data infrastructure provides "data-aware" pipelines with versioning and lineage.
4. ZenML
ZenMLis a structured MLOps framework that abstracts the creation of MLOps pipelines, allowing data scientists and ML engineers to focus on the core steps of data preprocessing, model training, evaluation, and deployment without getting bogged down in infrastructure details.
ZenML framework abstracts MLOps infrastructure complexities and simplifies the adoption of MLOps, making the AI project components accessible, reusable, and reproducible.
5. Prefect
Prefectis an MLOps orchestration framework for machine learning pipelines. It uses the concepts of tasks (individual units of work) and flows (sequences of tasks) to construct an ML pipeline for running different steps of an ML code, such as feature engineering and training. This modular structure enables ML engineers to simplify creating and managing complex ML workflows.
Prefect simplifies data workflow management, robust error handling, state management, and extensive monitoring.
6. Ray
Rayis a distributed computing framework that makes it easy for data scientists and ML engineers to scale machine learning workloads during model development. It simplifies scaling computationally intensive workloads, like loading and processing extensive data or deep learning model training, from a single machine to large clusters.
Ray's core distributed runtime, making it easy to scale ML workloads.
7. Metaflow
Metaflowis an MLOps tool that enhances the productivity of data scientists and ML engineers with a unified API. The API offers a code-first approach to building data science workflows, and it contains the wholeinfrastructure stackthat data scientists and ML engineers need to execute AI projects from prototype to production.
8. MLflow
MLflowallows data scientists and engineers to manage model development and experiments. It streamlines your entire model development lifecycle, from experimentation to deployment.
MLflow’s key features include: MLflow tracking:It provides an API and UI to record and query your experiment, parameters, code versions, metrics, and output files when training your machine learning model. You can then compare several runs after logging the results.
MLflow projects:It provides a standard reusable format to package data science code and includes API and CLI to run projects to chain into workflows. Any Git repository / local directory can be treated as an MLflow project.
MLflow models:It offers a standard format to deploy ML models in diverse serving environments.
MLflow model registry:It provides you with a centralized model store, set of APIs, and UI, to collaboratively manage the full lifecycle of a model. It also enables model lineage (from your model experiments and runs), model versioning, and development stage transitions (i.e., moving a model from staging to production).
9. Kubeflow
Kubeflowis an MLOps toolkit for Kubernetes. It is designed to simplify the orchestration and deployment of ML workflows on Kubernetes clusters. Its primary purpose is to make scaling and managing complex ML systems easier, portable, and scalable across different infrastructures.
Kubeflow is a key player in the MLOps landscape, and it introduced a robust and flexible platform for building, deploying, and managing machine learning systems on Kubernetes. This unified platform for developing, deploying, and managing ML models enables collaboration among data scientists, ML engineers, and DevOps teams.
10. Seldon core
Seldon coreis an MLOps platform that simplifies the deployment, serving, and management of machine learning models by converting ML models (TensorFlow, PyTorch, H2o, etc.) or language wrappers (Python, Java, etc.) into production-ready REST/GRPC microservices. Think of them as pre-packaged inference servers or custom servers. Seldon core also enables the containerization of these servers and offers out-of-the-box features like advanced metrics, request logging, explainers, outlier detectors, A/B tests, and canaries.
Seldon Core's solution focuses on model management and governance. Its adoption is geared toward ML and DevOps engineers, specifically for model deployment and monitoring, instead of small data science teams.
11. DVC (Data Version Control)
Implementing version control for machine learning projects entails managing both code and the datasets, ML models, performance metrics, and other development-related artifacts. Its purpose is to bring the best practices from software engineering, like version control and reproducibility, to the world of data science and machine learning.DVCenables data scientists and ML engineers to track changes to data and models like Git does for code, making it able to run on top of any Git repository. It enables the management of model experiments.
DVC's integration with Git makes it easier to apply software engineering principles to data science workflows.
12. Evidently AI
EvidentlyAIis an observability platform designed to analyze and monitor production machine learning (ML) models. Its primary purpose is to help ML practitioners understand and maintain the performance of their deployed models over time. Evidently provides a comprehensive set of tools for tracking key model performance metrics, such as accuracy, precision, recall, and drift detection. It also enables stakeholders to generate interactive reports and visualizations that make it easy to identify issues and trends.
13. Mage AI
Mage AIis a data transforming and integrating framework that allows data scientists and ML engineers to build and automate data pipelines without extensive coding. Data scientists can easily connect to their data sources, ingest data, and build production-ready data pipelines within Mage notebooks.
14. ML Run
ML Runprovides a serverless technology for orchestrating end-to-end MLOps systems. The serverless platform converts the ML code into scalable and managed microservices. This streamlines the development and management pipelines of the data scientists, ML, software, and DevOps/MLOps engineers throughout the entire machine learning (ML) lifecycle, across their various environments.
15. Kedro
Kedrois an ML development framework for creating reproducible, maintainable, modular data science code. Kedro improves AI project development experience via data abstraction and code organization. Using lightweight data connectors, it provides a centralized data catalog to manage and track datasets throughout a project. This enables data scientists to focus on building production level code through Kedro's data pipelines, enabling other stakeholders to use the same pipelines in different parts of the system.
Kedro focuses on data pipeline development by enforcing SWE best practices for data scientists.
16. WhyLogs
WhyLogsby WhyLabs is an open-source data logging library designed for machine learning (ML) models and data pipelines. Its primary purpose is to provide visibility into data quality and model performance over time.
With WhyLogs, MLOps engineers can efficiently generate compact summaries of datasets (called profiles) that capture essential statistical properties and characteristics. These profiles track changes in datasets over time, helping detect data drift – a common cause of model performance degradation. It also provides tools for visualizing key summary statistics from dataset profiles, making it easy to understand data distributions and identify anomalies.
17. Feast
Defining, storing, and accessing features for model training and online inference in silos (i.e., from different locations) can lead to inconsistent feature definitions, data duplication, complex data access and retrieval, etc.Feastsolves the challenge of stakeholders managing and serving machine learning (ML) features in development and production environments.
Feast is a feature store that bridges the gap between data and machine learning models. It provides a centralized repository for defining feature schemas, ensuring consistency across different teams and projects. This can ensure that the feature values used for model inference are consistent with the state of the feature at the time of the request, even for historical data.
Feast is a centralized repository for managing, storing, and serving features, ensuring consistency and reliability across training and serving environments.
18. Flyte
Data scientists and data and analytics pipeline engineers typically rely on ML and platform engineers to transform models and training pipelines into production-ready systems.
Flyteempowers data scientists and data and analytics engineers with the autonomy to work independently. It provides them with a Python SDK for building workflows, which can then be effortlessly deployed to the Flyte backend. This simplifies the development, deployment, and management of complex ML and data workflows by building and executing reliable and reproducible pipelines at scale.
19. Featureform
The ad-hoc practice of data scientists developing features for model development in isolation makes it difficult for other AI project stakeholders to understand, reuse, or build upon existing work. This leads to duplicated effort, inconsistencies in feature definitions, and difficulties in reproducing results.
Featureformis a virtual feature store that streamlines data scientists' ability to manage and serve features for machine learning models. It acts as a "virtual" layer over existing data infrastructure like Databricks and Snowflake. This allows data scientists to engineer and deploy features directly to the data infrastructure for other stakeholders. Its structured, centralized feature repository and metadata management approach empower data scientists to seamlessly transition their work from experimentation to production, ensuring reproducibility, collaboration, and governance throughout the ML lifecycle.
20. Deepchecks
Deepchecksis an ML monitoring tool for continuously testing and validating machine learning models and data from an AI project's experimentation to the deployment stage. It provides a wide range of built-in checks to validate model performance, data integrity, and data distribution. These checks help identify issues like model bias, data drift, concept drift, and leakage.
21. Argo
Argoprovides a Kubernetes-native workflow engine for orchestrating parallel jobs on Kubernetes. Its primary purpose is to streamline the execution of complex, multi-step workflows, making it particularly well-suited for machine learning (ML) and data processing tasks. It enables ML engineers to define each step of the ML workflow (data preprocessing, model training, evaluation, deployment) as individual containers, making it easier to manage dependencies and ensure reproducibility.
Argo workflows are defined using DAGs, where each node represents a step in the workflow (typically a containerized task), and edges represent dependencies between steps. Workflows can be defined as a sequence of tasks (steps) or as a Directed Acyclic Graph (DAG) to capture dependencies between tasks.
22. Deep Lake
Deep Lake(formerly Activeloop Hub) is an ML-specific database tool designed to act as a data lake for deep learning and a vector store for RAG applications. Its primary purpose is accelerating model training by providing fast and efficient access to large-scale datasets, regardless of format or location.
23. Hopsworks feature store
Advanced MLOps pipelines with at least anMLOps maturity level 1architecture require a centralized feature store.Hopsworksis a perfect feature store for such architecture. It provides an end-to-end solution for managing ML feature lifecycle, from data ingestion and feature engineering to model training, deployment, and monitoring. This facilitates feature reuse, consistency, and faster model development.
24. NannyML
NannyMLis a Python library specialized in post-deployment monitoring and maintenance of machine learning (ML) models. It enables data scientists to detect and address silent model failure, estimate model performance without immediate ground truth data, and identify data drift that might be responsible for performance degradation.
25. Delta Lake
Delta Lakeis a storage layer framework that provides reliability to data lakes. It addresses the challenges of managing large-scale data in lakehouse architectures, where data is stored in an open format and used for various purposes, like machine learning (ML). Data engineers can build real-time pipelines or ML applications using Delta Lake because it supports both batch and streaming data processing. It also brings ACID (atomicity, consistency, isolation, durability) transactions to data lakes, ensuring data integrity even with concurrent reads and writes from multiple pipelines.
Considering factors like popularity, impact, innovation, community engagement, and relevance to emerging AI trends can help guide your decision when picking open source AI/ML tools, especially for those offering the same value proposition. In some cases, such tools may have different ways of providing solutions for the same use case or possess unique features that make them perfect for a specific project use case.
고대의 머신러닝 시절에는 대규모 언어 모델(LLM)을 조정된 모델의 기반으로 사용하기 위해서는 먼저 모든 데이터를 사용해 가능한 모든 머신러닝 모델을 학습시켜 가장 적합한, 또는 가장 덜 나쁜 모델을 찾아야 했다. 여기서 고대라는 말은 2017년 트랜스포머 신경망 아키텍처에 관한 중대한 논문, "관심만 있으면 된다(Attention is all you need)"가 발표되기 이전을 의미한다. 물론 그로부터 몇 년이 지난 시점까지 대부분의 사람들은 여전히 가능한 모든 머신러닝 모델을 맹목적으로 학습시켰다. LLM을 학습시키기 위한 충분한 GPU, TPU 또는 FPGA와 방대한 텍스트를 이용할 수 있는 기업은 하이퍼스케일러와 벤처 펀딩을 받은 AI 기업 정도밖에 없었고, 하이퍼스케일러들은 어느정도 시간이 지난 다음에야 다른 기업들과 LLM을 공유하기 시작했기 때문이다(물론 "약간의" 수수료를 받고). 새로운 생성형 AI 패러다임에서의 개발 프로세스는 과거와는 상당히 다르다. 전체적인 개념을 보면 일단 생성형 AI 모델(하나 또는 여러 개)을 선택한다. 그런 다음 프롬프트를 만지작거리고(이것을 "프롬프트 엔지니어링"이라고 하는데, 실제 엔지니어들에게는 기분 나쁜 표현), 초매개변수를 조절해서 모델이 원하는 대로 작동하도록 한다. 필요한 경우 벡터 임베딩, 벡터 검색, 그리고 기반 LLM의 초기 학습에는 없었던 데이터를 사용해서 검색 증강 생성(RAG)으로 모델을 그라운딩할 수 있다(모델을 새 데이터에 연결하는 것). 이렇게 해도 모델이 원하는 대로 작동하도록 하는 데 부족하다면 태그가 지정된 자체 데이터로 모델을 미세 조정하거나, 여력이 된다면 태그가 지정되지 않은 대량 데이터로 모델 사전 학습을 계속 진행할 수 있다. 모델을 미세 조정하는 이유 중 하나는 모델이 사용자와 대화하고 대화 과정에서 맥락을 유지하도록 하기 위해서다(예: 챗GPT). 이 기능은 기반 모델에는 일반적으로 내장돼 있지 않다(예: GPT). 에이전트는 툴, 실행 코드, 임베딩, 벡터 저장소의 조합을 통해 대화형 LLM의 개념을 확장한다. 즉, 에이전트는 RAG에 부가적인 단계를 더한 것이다. 에이전트는 LLM을 특정 도메인에 전문화하고 LLM의 출력을 맞춤 설정하는 데 유용한 경우가 많다. LLM과 다른 소프트웨어 및 서비스의 통합을 간소화하는 다양한 플랫폼, 프레임워크, 모델이 있다.
1단계 : 모델 선택
우선 모델을 선택할 때는 나중에 다른 모델로 어떻게 전환할지에 대해 생각해야 한다. LLM은 거의 매일 개선되므로 금방 뒤쳐지거나 구식이 될 수 있는 모델에 묶이지 않는 것이 좋다. 이 문제에 대처하려면 서로 다른 벤더에서 두 개 이상의 모델을 선택해야 한다. 또한 지속적인 추론 비용도 고려해야 한다. 서비스로 제공되는 모델을 선택하면 추론별로 비용을 지불하게 되므로 트래픽이 낮을 경우 비용이 덜 든다. 플랫폼형 모델을 선택하는 경우 트래픽을 처리하기 위해 프로비저닝하는 VM에 대해 월 고정비가 지출된다. 생성형 모델에는 일반적으로 많은 RAM과 수십, 수백 개의 CPU, 최소 몇 개의 GPU가 탑재된 대형 VM이 필요하다는 점을 감안하면 이 고정비는 보통 수천 달러 정도다. 기업에 따라 오픈소스 생성형 AI 모델을 고집하는 경우도 있고 오픈소스 여부를 따지지 않는 경우도 있다. 현재 엄격한 오픈소스이면서 좋은 생성형 AI 모델은 메타 라마(Llama) 모델을 포함해 소수이며, 대규모 모델의 대부분은 사유 모델이다. X의 그록(Grok. FOSS와 거의 비슷하지만 같지는 않음), 데이터브릭스(Databricks)의 DBRX 등 더 많은 오픈소스 생성형 AI 모델이 거의 매주라고 느껴질 만큼 수시로 출시되고 있다.
2단계 : 프롬프트 엔지니어링
프롬프트 엔지니어링은 LLM을 맞춤 설정하는 가장 쉽고 빠른 방법이다. 얼핏 간단해 보이지만 잘 하기 위해서는 일정한 기술과 섬세함이 필요하다는 면에서 모차르트 작품과 비슷하다. 프롬프트 엔지니어링에 대한 글은 많다. 간단히 이 용어를 검색해보면 3억 개가 넘는 결과가 반환된다. 또 다른 글을 더할 의미가 없으니, 여기서는 가장 유용한 프롬프트 엔지니어링 기법을 간략히 살펴보자. 생성형 AI 프롬프트에서 좋은 결과를 얻기 위한 전체적인 전략에는 당연한 이야기가 많이 포함된다. 예를 들어 오픈AI가 프롬프트 엔지니어링을 위해 가장 중요하게 제안하는 "명확한 지침을 쓸 것"도 마찬가지다. 그러나 세부적인 전술은 이처럼 분명하지 않을 수 있다. 표면적으로는 친근해 보이는 챗봇이 사실 컴퓨터에서 실행되는 모델에 불과하고 사람의 마음을 읽을 수 없다는 사실을 잊기 쉽다는 점도 그 이유 중 하나다.
프롬프트 엔지니어링 포인터
예를 들어 신입 사원에게 업무를 가르치듯이 모델에 수행할 작업을 단계별로 설명해야 할 수 있다. 모델이 사용할 출력 형식을 보여줘야 할 수도 있다. 모델이 원하는 길이의 답을 제공할 때까지 반복적으로 지시하고, 사실에 근거하고 멋대로 덧붙이지 말도록 명시적으로 지시해야 할 수 있다. 이를 위한 유용한 프롬프트 중 하나는(항상 통하지는 않지만) "정보가 부족해서 답할 수 없다면 그렇다고 말 해"라는 것이다. 모델에 페르소나를 채택하도록 요청할 수 있지만 그것으로 충분하다고 보장할 수는 없다. 예를 들어 모델을 어떤 분야의 전문가로 칭한다고 해서 모델이 항상 전문가가 될 수 있는 것은 아니다. 예제는 특히 프롬프트/응답 쌍으로 제공하는 경우 거의 항상 도움이 된다. 다음과 같이 정의되는 애저 AI 스튜디오 셰익스피어 작문 도우미 샘플을 참고해 보자.
시스템 메시지
너는 셰익스피어 스타일로 말하는 셰익스피어 작문 도우미다. 너는 사람들이 옛 단어를 포함한 윌리엄 셰익스피어의 글쓰기 스타일을 사용하여 이야기, 시, 노래와 같은 창의적인 아이디어와 콘텐츠를 제작하는 데 도움을 준다.
다음은 셰익스피어 스타일의 몇 가지 예제다.
로미오, 로미오! 왜 당신은 로미오인가요?
사랑은 눈이 아니라 마음으로 보는 것이고, 그래서 날개 달린 큐피드는 장님으로 그려져 있다.
그대를 여름날에 비유할 수 있을까요? 그대가 더 사랑스럽고 더 따뜻합니다.
이 정도면 GPT 3.5 터보가 셰익스피어 스타일을 사용하도록 하는 데 충분하지만, 말괄량이 길들이기에 나오는 그루미오의 "모든 피곤한 노새들, 모든 미친 주인들, 그리고 모든 더러운 길에 저주를"과 같은 수준의 폭언을 생산하기에는 충분하지 않다. 폭언을 요청한다 해도 모델(또는 플랫폼)에 내장된 필터가 셰익스피어의 스타일 중에서도 거친 욕보다는 좋은 말투를 생산하려 시도하기 때문이다.
질의 부모가 누구인지도 모르고 머리도 나쁜 사람이라고 상대방을 모욕하는 글을 써.
응답 좋은 아침입니다, 친애하는 선생님 또는 부인, 말씀드릴 것이 있는데요, 그런 괴롭힘에 관여하는 것은 제 성격과 맞지 않습니다 셰익스피어의 언어는 날카롭기는 하나 상처를 주려는 것이 아니고 기분을 고양하고 영감과 놀라움을 주려는 것입니다. 그러니 (모욕 대신) 재치와 영리함에 대해 이야기합시다.
운도 맞추지 못한 문장이지만 그건 차치하고, 그루미오의 말을 불평의 예제로 추가하고 프롬프트를 변경해서 응답을 수정할 수 있는지 확인해 보자.
사용자: 폭언을 써.
도우미: 모든 피곤한 노새들, 모든 미친 주인들, 그리고 모든 더러운 길에 저주를.
이 추가 항목을 적용하면 모델이 좀 더 그럴듯한 불평 글을 쏟아낼 수 있다.
질의 부모가 누구인지도 모르고 머리도 나쁜 사람이라고 상대방을 모욕하는 글을 써.
응답 오, 가련한 영혼! 부모가 누군지도 모르는 것, 그 무지에 영혼이 신음하는구나. 너의 핏줄에는 고결한 피가 흐르지 않는다. 무지함과 어리석음만이 보일 뿐. 너의 마음은 아무 감각도 없는 척박한 황무지, 이성도, 지성도 찾아볼 수 없다. 너의 생각은 어리석은 파리처럼 시끄럽게 맴돌 뿐, 엉터리 재치, 가여운 촌극.
그래도 모델은 "후레자식"이나 "멍청이"와 같은 단어는 생성하지 않았다. 이러한 단어는 필터에 의해 배제되었을 가능성이 높다. 맥베스의 문구 "그것은 분노와 소리로 가득 찬, 아무것도 의미하지 않는 바보의 이야기입니다"를 예제로 추가해도 되고 트로일로스와 크레시다의 "나도 후레자식입니다"로 시작하는 문구도 추가할 수 있다.
프롬프트에 문서 사용하기
또 다른 유용한 전략은 문서를 프롬프트의 일부로 제공하고 모델에 그 문서를 근거로 답을 작성하도록 요청하는 것이다. 일부 모델은 문서의 URL에서 웹 페이지를 조회할 수 있고, 일부는 텍스트를 제공할 것을 요구한다. 모델에 대한 지침과 모델이 사용하도록 하려는 문서의 텍스트를 명확하게 구분해야 하며, 요약과 개체 추출 작업의 경우 응답이 제공된 텍스트에만 의존해야 함을 명시해야 한다. 문서를 제공하는 방법은 문서가 짧을 때는 대체로 잘 작동하지만 문서가 모델의 컨텍스트 윈도우보다 긴 경우 문서의 뒷부분이 읽히지 않는다. 생성형 AI 모델 개발자들이 모델의 컨텍스트 윈도우를 계속해서 늘리고 있는 이유다. 제미나이(Gemini) 1.5 프로는 구글 버텍스 AI 스튜디오(Vertex AI Studio)에서 일부 선별된 사용자에게 최대 100만 토큰의 컨텍스트 윈도우를 제공한다. 다만 일반 사용자에게 제공되는 컨텍스트 윈도우는 12만 8,000 토큰에 "불과"하다. 나중에 다시 언급하겠지만 컨텍스트 윈도우 제한을 우회하는 방법 중 하나는 RAG를 사용하는 것이다. LLM에 긴 문서의(컨텍스트 윈도우를 초과할 정도로 길지는 않음) 요약을 요청하면 LLM이 다른 소스에서 가져온, "사실"이라고 생각하는 내용을 추가하는 경우가 간혹 있다. 요약이 아닌 문서를 압축하도록 요청하면 대부분 내용 추가 없이 요청에 응한다.
밀도의 사슬 프롬프트 사용
요약을 개선하는 또 다른 방법은 컬럼비아, 세일즈포스, MIT 팀이 2023년에 GPT-4 전용으로 제안한 밀도의 사슬(CoD: Chain-of-Density) 프롬프트를 사용하는 것이다(논문).KD너겟(KDnuggets) 기사는 이 논문의 프롬프트를 더 알기 쉽게 정리하고 부가적인 설명을 더했다. 논문과 기사 모두 읽어볼 것을 권한다. 간단히 요약하면 CoD 프롬프트는 모델에 기본 문서의 요약을 5번 반복하면서 각 단계에서 정보 밀도를 높이도록 요청한다. 논문에 따르면 사람들은 대체로 5번의 요약 중에서 세 번째를 가장 좋아한다. 참고로 논문에서 GPT-4용으로 나온 프롬프트는 다른 모델에서는 제대로 작동하지 않거나 아예 작동하지 않을 수 있다.
생각의 사슬 프롬프트 사용
2022년에 나온 생각의 사슬(Chain-of-Thought) 프롬프트(논문)는 LLM에 일련의 중간 추론 단계를 사용하도록 요청하는 방식으로 "대규모 언어 모델의 복잡한 추론 수행 능력을 대폭 개선"한다. 예를 들어 생각의 사슬 프롬프팅는 초등학교 수준의 수학이지만 LLM이 제대로 푸는 데 어려움을 겪는 산술 단어 문제를 잘 푼다. 논문에서 저자들은 생각의 사슬 시퀀스 예제를 퓨샷 프롬프트에 통합했다. 생각의 사슬 프롬프팅을 위한 아마존 베드록 예제는 "너는 탁월한 비판적 사고 능력을 가진 매우 지능적인 봇"이라는 시스템 지침과 "단계별로 생각해 보자"는 사용자 지침을 통해 라마 2 챗 13B와 70B 모델에서 다단계 추론을 이끌어낸다.
생각의 뼈대 프롬프트 사용
생각의 뼈대(Skeleton-of-thought) 프롬프트(논문)는 2023년에 제시됐으며, "먼저 응답의 뼈대를 생성하도록 LLM을 이끈 다음 병렬 API 호출 또는 일괄 디코딩을 수행해서 각 뼈대 포인트의 콘텐츠를 병렬로 완성"하는 방식으로 LLM의 지연을 줄이는 방법이다. 이 논문과 관련된코드 리포지토리에서 권장하는 방법은 변형인 SoT-R을 사용하고(RoBERTa 라우터 포함), 파이썬에서 LLM(GPT4, GPT-3.5 또는 클로드)을 호출하는 것이다. 프롬프트 엔지니어링은 궁극적으로는 모델 자체에 의해 수행될 수 있다. 이미 이와 관련된연구도 진행된 바 있다. 핵심은 모델이 사용할 수 있는 정량적 성공 지표를 제공하는 것이다.
3단계 : 초매개변수 조정
LLM은 프롬프트의 일부로 설정할 수 있는 초매개변수가 있는 경우가 많다. 초매개변수 조정은 머신러닝 모델 학습 못지않게 LLM 프롬프트에서도 중요하다. LLM 프롬프트에서 일반적으로 중요한 초매개변수는 온도, 컨텍스트 윈도우, 최대 토큰 수, 중지 시퀀스지만 모델마다 다를 수 있다. 온도는 출력의 무작위성을 제어한다. 모델에 따라 온도 범위는 0~1 또는 0~2다. 온도 값이 높을수록 더 높은 무작위성을 요청한다. 0은 모델에 따라 "온도를 자동으로 설정"하라는 의미인 경우도 있고, "무작위성 없음"을 의미하는 경우도 있다. 컨텍스트 윈도우는 모델이 답변을 위해 고려하는 선행 토큰(단어 또는 하위 단어)의 수를 제어한다. 최대 토큰 수는 생성된 답변의 길이를 제한한다. 중지 시퀀스는 출력에서 모욕적이거나 부적절한 콘텐츠를 억제하는 데 사용된다.
4단계 : 검색 증강 생성
검색 증강 생성(RAG)은 LLM을 특정 소스에 그라운딩하는 데 유용하다. 여기서 소스는 모델의 원래 학습에는 포함되지 않은 소스인 경우가 많다. 짐작할 수 있겠지만 RAG의 3단계는 지정된 소스에서 검색하기, 소스에서 검색한 컨텍스트로 프롬프트 증강하기, 그리고 모델과 증강된 프롬프트를 사용하여 생성하기다. RAG 절차는임베딩을 사용해서 길이를 제한하고 검색된 컨텍스트의 관련성을 개선하는 경우가 많다. 기본적으로 임베딩 기능은 단어 또는 구를 가져와 이를 부동소수점 숫자의 벡터에 매핑한다. 이는 일반적으로 벡터 검색 인덱스를 지원하는 데이터베이스에 저장된다. 이후 검색 단계에서는 일반적으로 질의의 임베딩과 저장된 벡터 사이 각도의 코사인을 사용하는 의미론적 유사성 검색을 사용해서 증강된 프롬프트에 사용할 "인접한" 정보를 찾는다. 검색 엔진도 보통 이와 동일한 방법을 사용해 답을 찾는다.
5단계 : 에이전트
에이전트(대화형 검색 에이전트)는 툴과 실행 코드, 임베딩, 벡터 저장소의 조합으로 대화형 LLM의 개념을 더 확장한다. 에이전트는 특정 도메인으로 LLM을 전문화하고 LLM의 출력을 맞춤 설정하는 데 유용한 경우가 많다. 애저 코파일럿은 일반적으로 에이전트다. 구글과 아마존은 "에이전트"라는 용어를 사용하며, 랭체인(LangChain)과 랭스미스(LangSmith)는 RAG 파이프라인과 에이전트 구축을 간소화한다.
6단계 : 모델 미세 조정
대규모 언어 모델(LLM) 미세 조정은 특정 작업에 맞게 모델의 매개변수를 조절하는 지도 학습 프로세스다. 미세 조정에서는 대상 작업과 관련된 예제로 레이블이 지정된 더 작은 작업별 데이터 집합을 사용해 모델을 학습시킨다. 미세 조정은 다수의 서버 수준 GPU를 사용하고 몇 시간 또는 며칠이 걸리며 수백 또는 수천 개의 태그가 지정된 예제가 필요하다. 확장 사전 학습에 비해서는 여전히 훨씬 더 빠르다. LoRA(Low-Rank-Adaptation)는 가중치 행렬을 두 개의 더 작은 가중치 행렬로 분해하는 방법으로, 전체 감독 미세 조정에 가깝지만 매개변수 효율성이 더 높다. 마이크로소프트의 첫 LoRA 논문은 2021년에 발표됐다. 2023년에 나온 LoRA의 양자화된 변형인 QLoRA는 조정 프로세스에 필요한 GPU 메모리의 양을 줄였다. 일반적으로 LoRA와 QLoRA는 표준 미세 조정에 비해 태그가 지정된 예제의 수와 필요한 시간을 줄여준다.
7단계 : 지속적인 모델 사전 학습
사전 학습은 방대한 텍스트 데이터 집합에 대한 비지도 학습 프로세스로, LLM에 언어의 기본 사항을 가르치고 일반적인 기본 모델을 생성한다. 확장 또는 지속적인 사전 학습은 레이블이 지정되지 않은 도메인별 또는 작업별 데이터 집합을 이 기본 모델에 추가해서 예를 들어 언어를 추가하고 의학과 같은 전문 분야를 위한 용어를 추가하거나 코드 생성 기능을 추가하는 등 모델을 전문화한다. 지속적인 사전 학습(비지도 학습 사동) 뒤에는 보통 미세 조정(지도 학습 사용)이 실행된다. 머신러닝, 딥러닝, 대규모 언어 모델과 관련된 모든 것이 그렇듯이 생성형 AI 개발 프로세스 역시 많은 경우 예고도 없이 변경될 수 있다. 그럼에도 불구하고 대부분의 기업은 여전히 지금의 프로세스를 달성하고자 한다. 이제 여러분에게 조직을 위해 변화를 이끌 동력이 아마 생겼을 것이다.
아태지역 AI 시장에서 생성형 AI의 비중이 더 커질 것이라는 전망이 나왔다. 중국이 앞서가는 가운데 일본과 인도 시장이 빠르게 성장하리라는 분석이다.
30일 시장조사업체 한국IDC가 ‘전 세계 AI 및 생성형 AI 지출 가이드’ 보고서를 발표했다. 중국과 일본을 포함한 아시아 태평양 지역의 AI 시장을 조사했다. AI 기반 시스템을 위한 소프트웨어, 서비스, 하드웨어를 포함한다. 보고서에 따르면, 아태 지역 생성형 AI 지출은 연 평균 95.4% 성장해 2027년에는 260억 달러 규모가 될 전망이다. 생성형 AI의 비중은 더 커진다. 생성형 AI는 2024년 전체 AI 시장의 15%를 차지하지만, 2027년에는 29%까지 늘어날 것으로 업체는 예상했다.
IDC 아태지역에서 빅데이터 및 AI 리서치 헤드 디피카 기리는 "아시아 태평양 지역에서 생성형 AI의 도입이 급증하며 향후 2년 이내에 투자가 정점에 도달한 후 안정화 기간을 거칠 것으로 예상된다. 중국은 생성형 AI 기술 관련 지배 시장 위치를 유지할 것이며, 일본과 인도는 향후 몇 년 동안 가장 빠르게 성장하는 시장이 될 것이다"라고 말했다.
산업별로 보면, 금융, 소프트웨어 및 IT, 정부, 리테일, 내구재 등의 부문에서 성장이 두드러진다. 금융 서비스 산업의 AI 지출은 2027년까지 연평균 96.7%씩 성장해 43억 달러 규모를 형성할 전망이다. 사내 운영 효율성 개선, 반복 작업 자동화, 사기 탐지 및 복잡한 문서 작성과 같은 백오피스 프로세스 최적화에 생성형 AI를 주로 활용하는 추세라고 보고서는 분석했다.
소프트웨어 및 IT 산업은 마케팅, 데이터 분석, 소프트웨어 개발 등 다양한 분야에서 생성형 AI를 활용한다. 생성형 AI는 콘텐츠 제작을 간소화하여 마케팅 전략을 최적화하고 오디언스 참여를 극대화하며, 소프트웨어 개발 분야에서는 코딩 작업을 자동화하고 프로토타입을 생성해 개발자의 생산성과 효율성을 높이는 데 기여하는 것으로 나타났다.
정부 부문에서는 생성형 AI 기술 교육과 훈련을 발전시켜 새로운 일자리를 창출하고 기술 혁신 허브의 성장을 촉진하는 데 활용하고, 리테일 산업에서는 개인 맞춤화 경험 제공을 위해 AI 기술을 활용하는 것으로 보고서는 분석했다.