농민을 위한 RAG 기반 LLM 농업 자문 프레임워크: 4개 오픈 LLM 비교
Empowering farmers with artificial intelligence: a retrieval-augmented generation based large language model advisory framework
TL;DR Highlight
농업 문서를 RAG로 붙여 4개 LLM을 비교하니 Mistral·Qwen2.5가 최고
Who Should Read
도메인 문서(매뉴얼·가이드)로 RAG 챗봇을 만들며 어떤 오픈 LLM을 쓸지 고민하는 백엔드 개발자
Core Mechanics
- 농업 가이드 문서로 RAG 자문 시스템을 만들었다
- 옥수수·ragi·고구마·목화·땅콩 5개 작물의 재배법(PoP) 문서를 처리한다.
- 병해충 관리, 비료 사용 같은 질문에 문서 근거로 답한다.
- 파이프라인은 흔한 RAG 구성이다
- 문서를 의미 단위로 쪼개(semantic chunking) Amazon Titan 임베딩(BedrockEmbeddings)으로 벡터화한다.
- ChromaDB에 넣고, 질문과 가장 비슷한 청크를 찾아 구조화된 프롬프트에 끼워 넣는다.
- Llama3.1·Mistral·Phi3·Qwen2.5를 같은 조건에서 비교했다
- 검색 품질, 문자 겹침, 의미 유사도, 출처 표기, 속도까지 여러 축으로 쟀다.
- Mistral과 Qwen2.5가 가장 좋았다
- 원문은 두 모델이 관련성, 의미 품질, 효율에서 앞섰다고 밝힌다.
- 정답 일치만 보지 않고 출처 표기와 속도도 평가했다
- attribution score로 답이 출처 문서를 얼마나 따르는지 봤다.
- 검색 시간, 생성 시간, 전체 시간도 따로 쟀다.
Evidence
- 평가 지표를 다섯 묶음으로 나눴다
- 검색은 precision@K, recall@K, MRR, NDCG로 쟀다.
- 문자 겹침은 BLEU, ROUGE-1/2/L로 쟀다.
- 의미 품질은 BERTScore와 faithfulness로 쟀다
- BERTScore의 precision, recall, F1과 semantic similarity, faithfulness를 썼다.
- 비교 대상은 4개 LLM이다
- Llama3.1, Mistral, Phi3, Qwen2.5를 비교했고 Mistral과 Qwen2.5가 최고 성능이었다.
- 원문 초록에는 구체적인 수치가 없다.
How to Apply
- 우리 문서로 4개 모델을 같은 프롬프트로 비교하기
- 오늘 Ollama 등으로 Mistral과 Qwen2.5를 받아 같은 검색 결과와 질문 20개를 넣어라.
- 답이 근거 문서와 맞는지 사람이 눈으로 점검하라.
- 검색과 생성을 따로 평가하기
- 검색은 precision@K와 MRR로, 생성은 faithfulness로 나눠 측정하라.
- 틀린 답이 검색 탓인지 모델 탓인지 구분하라.
- 답변에 출처 청크를 붙이는 비율 측정하기
- 프롬프트에 근거 청크 번호를 인용하도록 요구하라.
- 인용한 답변의 비율을 attribution 지표로 추적하라.
- 검색·생성 시간을 로그로 분리하기
- 요청마다 retrieval time과 generation time을 기록하라.
- 모델 교체 시 지연을 같이 비교하라.
Try It
# Claude나 ChatGPT에 붙여넣기 (논문 방법의 간이 버전: 근거 기반 답변과 출처 표기 점검)
너는 농업 자문가다. 아래 [문서 조각]에 있는 내용만 근거로 질문에 답하라.
규칙:
1. 각 문장 끝에 근거 조각 번호를 [1]처럼 붙인다.
2. 문서에 없으면 "문서에 근거 없음"이라고 답한다.
3. 마지막에 인용 번호 목록과 문서에서 확인되지 않은 주장이 있는지 점검해 적는다.
[문서 조각]
{{검색된 청크들(번호 포함)}}
[질문]
{{질문}}Terminology
관련 논문
FutureBench: LLM의 지식-컨텍스트 충돌을 반복 측정하는 벤치마크
RAG 프롬프트에 '검증하고 문서 우선'을 넣었더니 거짓 문서 채택이 늘었다
Apple의 학습형 MIPS: 작은 신경망으로 RAG 검색 라우팅 가속하기
작은 신경망으로 검색 경로를 학습했더니 같은 recall을 최대 8배 빠르게 얻었다
Memorilla: frozen LLM을 위한 잠재 의미 메모리
문서를 16개 메모리 토큰으로 압축했더니 FactKG에서 풀컨텍스트보다 정확도가 높았다
작성자가 쓴 것, 에이전트가 읽는 것: 문서 수집 단계의 조용한 서식 정보 손실
docx 변환 시 빨간 글자·형광펜을 살렸더니 중요 요구사항 복원 F1이 0.150→0.690으로 올랐다
멀티모달 리랭킹은 System One 결정이다: 범용 VLM에 객관식 한 번으로 재정렬하기
VLM에 후보 16개 객관식 질문 한 번으로 리랭킹, 2B 전용 리랭커를 앞섰다
트랜스포머는 '기억 저장소'에서 처음부터 만들어 낼 수 있었다
선형층→MLP→self-attention을 기억 저장소로 보면 용량이 64→약 2,700→100만 이상
400년치 고문서에 AI를 돌렸더니 잊힌 운석·코뿔소·화산 폭발이 나왔다
임베딩 검색과 싼 필터 모델로 400년 고문서를 뒤져 미기록 사건 발굴
EmbeddingGemma 2: 텍스트·이미지·오디오·비디오를 한 벡터 공간에 넣는 오픈 경량 임베딩 모델
740M 오픈 모델 하나로 텍스트·이미지·오디오·비디오를 같은 벡터 공간에서 검색
Original Abstract (Expand)
This study presents a retrieval augmented generation (RAG) based system designed to provide farmers with expert agricultural advisory services. The framework delivers context aware guidance on critical practices such as crop cultivation, pest and disease management, fertilizer application, and other agronomic practices, and compares the performance of four large language models (LLMs) in generating these recommendations. The system processes package of practices (PoP) documents for five major crops maize, ragi, sweet potato, cotton, and groundnut through semantic chunking and embedding using Amazon Titan via BedrockEmbeddings. Vector representations are indexed in ChromaDB to enable efficient similarity search for query-relevant content retrieval. Upon receiving user queries, the system retrieves the most semantically similar document chunks and incorporates them into structured prompts. Four LLMs such as Llama3.1, Mistral, Phi3, and Qwen2.5 were evaluated for their effectiveness in generating accurate agricultural recommendations. Performance was evaluated across multiple dimensions. Relevance and retrieval were assessed using precision@K, recall@K, mean reciprocal rank (MRR), and normalized discounted cumulative gain (NDCG). Lexical overlap was measured with the bilingual evaluation understudy (BLEU) and recall-oriented understudy for gisting evaluation (ROUGE-1, ROUGE-2, ROUGE-L) metrics. Semantic quality was analyzed using Bidirectional Encoder Representations from transformers score (BERTScore) precision, recall, F1, semantic similarity and faithfulness to capture contextual alignment between generated and reference responses. Source attribution was assessed through the attribution score, while efficiency was measured using retrieval time, generation time, and total time. Overall, mistral and Qwen2.5 achieved the highest performance, demonstrating superior relevance, semantic quality, and efficiency. This evaluation highlights which LLMs perform best for the agricultural domain and illustrates the potential of knowledge-grounded AI systems to democratize agricultural expertise, particularly in regions with limited access to traditional advisory services.