머신러닝부터 LLM 애플리케이션 운영까지: ML·Foundation Model·MLOps 개념 지도

반응형

머신러닝, deep learning, foundation model, LLM, multimodal, LangChain, MLOps는 서로 다른 층의 용어다. 한 줄의 발전사로 외우면 model architecture와 application framework, 운영 practice가 섞인다. 이 글은 각 용어를 학습 방식 → 모델 → 입출력 → 애플리케이션 → 운영 순서로 다시 배치한다.

먼저 층을 나누면

문제와 데이터
  ↓
학습 방식: supervised / unsupervised / reinforcement / self-supervised
  ↓
모델 구조: tree / neural network / Transformer 등
  ↓
사전학습 모델: foundation model, 그중 language 중심이면 LLM
  ↓
애플리케이션: prompt, retrieval, tool, agent workflow
  ↓
운영: version, evaluation, deployment, observability, feedback

LangChain은 애플리케이션 orchestration을 돕는 선택지이고, LangSmith는 trace·evaluation·monitoring을 돕는 별도 platform이다. 둘을 사용한다고 자동으로 MLOps가 완성되는 것은 아니다.

머신러닝의 학습 신호부터 구분한다

Supervised learning

입력과 label 쌍에서 예측 함수를 학습한다. regression은 연속값을, classification은 class나 class probability를 예측하는 대표 문제다. linear regression, logistic regression, tree, neural network는 서로 다른 algorithm이며 데이터 규모만으로 선택하지 않는다.

Unsupervised learning

명시적인 target label 없이 data structure나 representation을 찾는다. clustering과 dimensionality reduction이 대표적이다. cluster 번호는 원래 정답 class가 아니며, K-means의 K와 distance scale, PCA의 linearity 같은 가정을 확인해야 한다.

Reinforcement learning

agent가 environment와 상호작용하며 observation, action, reward를 바탕으로 policy를 학습한다. model-free와 model-based는 environment dynamics model을 학습·사용하는지에 관한 중요한 구분이다.

기존 글의 ‘DQN = AlphaGo’ 연결은 정확하지 않다. DQN은 value-based deep reinforcement learning의 대표 연구이고, AlphaGo는 policy network·value network·Monte Carlo tree search를 결합했다. 유명 사례 하나로 algorithm을 동일시하지 않는 것이 좋다.

Self-supervised learning

원시 데이터의 일부를 가리거나 다음 요소를 예측하는 식으로 data 자체에서 training signal을 만든다. 많은 foundation model의 pretraining을 이해할 때 supervised·unsupervised의 단순 양분보다 이 층이 중요하다.

Deep Learning과 Foundation Model은 같은가

deep learning은 여러 층의 neural network로 representation을 학습하는 방법론이다. foundation model은 넓은 data로 학습한 뒤 다양한 downstream task에 adaptation할 수 있는 기반 모델이라는 배치 관점의 개념이다. 많은 foundation model이 deep neural network를 사용하지만 두 용어의 기준은 다르다.

LLM은 language token을 중심으로 학습한 large model을 가리킨다. 모든 foundation model이 LLM인 것도, 모든 LLM application이 text만 받는 것도 아니다. model이 image·audio를 함께 처리할 수 있는지, application이 어느 modality를 입출력으로 노출하는지, 학습 목표가 무엇인지를 분리해서 본다.

Single-modal과 Multimodal

  • single-modal system은 text처럼 한 종류의 input representation을 중심으로 동작한다.
  • multimodal system은 text·image·audio 등 둘 이상의 modality를 함께 처리하거나 서로 변환한다.

제품 이름을 ‘항상 single-modal’ 또는 ‘항상 multimodal’이라고 기억하는 방식은 금방 낡는다. 같은 model family라도 version과 endpoint에 따라 지원 input/output이 다를 수 있기 때문이다. 실제 설계에서는 사용하는 model의 현재 API documentation에서 modality, file limit, token·latency·cost 조건을 확인한다.

NLP model의 변화는 한 줄짜리 승계가 아니다

2017년 Transformer 논문은 recurrence와 convolution 없이 attention을 중심으로 한 encoder-decoder architecture를 제안했다. 이후 encoder-only, decoder-only, encoder-decoder 계열이 서로 다른 pretraining objective와 task에 활용됐다.

구조 관점 대표적인 강점 주의할 점
encoder-only 입력 전체의 contextual representation ‘이해 전용’이라는 절대 규칙은 아니다
decoder-only 이전 token을 조건으로 한 autoregressive generation generation 외 task에도 adaptation할 수 있다
encoder-decoder 입력 sequence를 조건으로 출력 sequence 생성 번역·요약 외에도 다양한 task에 쓰인다

‘BERT는 이해, GPT는 생성’은 첫 방향을 잡는 기억법일 수 있지만 model architecture와 가능한 task를 고정하는 정의는 아니다. attention, objective, data, adaptation method를 함께 봐야 한다.

LangChain과 LangSmith의 위치

LangChain은 model call, tool, middleware, agent loop 같은 application component를 조합하는 framework다. 작은 한 번의 model call에는 SDK만으로 충분할 수 있고, 복잡한 orchestration이 필요할 때 framework의 가치와 추상화 비용을 비교한다.

LangSmith는 application run을 trace하고 offline·online evaluation을 구성하며 production behavior를 관찰하는 platform이다. trace에는 prompt, retrieved context, tool input/output처럼 민감한 data가 들어갈 수 있으므로 다음 항목을 먼저 설계해야 한다.

  • 개인·업무 data의 masking과 접근 권한
  • sampling과 retention 기간
  • application version, model, prompt, dataset의 식별자
  • latency·token·cost와 task quality의 공동 관찰
  • 실패 trace를 regression dataset으로 되돌리는 절차

MLOps와 LLMOps에서 실제로 운영할 것

MLOps는 model을 배포하는 CI/CD 하나가 아니다. data와 code, model artifact, evaluation evidence를 함께 재현하고 production feedback을 다음 변경에 연결하는 운영 체계다.

단계 확인할 산출물 대표 질문
data schema, lineage, quality check, split training과 evaluation data가 섞이지 않았나
experiment code·config·seed·metric 같은 조건에서 비교 가능한가
evaluation dataset, metric, human rubric, guardrail 평균 점수 뒤의 실패 유형은 무엇인가
release model·prompt·retrieval index version 어떤 변경이 production에 갔나
serving latency, error, saturation, cost user impact와 resource가 함께 보이나
feedback trace, label, incident, drift evidence 어떤 증거로 retrain·rollback을 결정하나

LLM application은 정답이 하나가 아닌 경우가 많아 offline benchmark만으로 부족하다. deterministic rule, reference-based metric, human review, model-based evaluator를 목적에 맞게 조합하고, evaluator 자체의 bias와 비용도 검증한다.

기초 수학 용어가 필요하면 딥러닝을 읽기 위한 수학 개념 지도, 실제 text classification 흐름은 NLP 텍스트 분류 학습노트로 이어갈 수 있다.

자주 묻는 질문

Foundation model과 LLM은 같은가

LLM은 foundation model의 대표적인 한 종류로 볼 수 있지만 foundation model은 language에만 한정되지 않는다. 모델의 training data, objective, adaptation 범위를 확인해야 한다.

LangChain을 쓰면 MLOps가 해결되나

아니다. application orchestration은 일부일 뿐이다. data·evaluation·version·deployment·observability·feedback과 보안 정책이 별도로 필요하다.

Multimodal model이면 무조건 더 좋은가

아니다. 문제에 필요 없는 modality는 latency, cost, privacy surface만 늘릴 수 있다. 입력 정보와 평가 기준이 실제 task에 도움이 되는지 확인한다.

참고 자료

반응형
KEEP READING
카테고리 전체 보기 →

댓글