pith. sign in

arxiv: 2401.08406 · v3 · pith:ZPESEEWXnew · submitted 2024-01-16 · 💻 cs.CL · cs.LG

RAG vs Fine-tuning: Pipelines, Tradeoffs, and a Case Study on Agriculture

classification 💻 cs.CL cs.LG
keywords fine-tuningllmspipelineknowledgemodelresultsaccuracyacross
0
0 comments X
read the original abstract

There are two common ways in which developers are incorporating proprietary and domain-specific data when building applications of Large Language Models (LLMs): Retrieval-Augmented Generation (RAG) and Fine-Tuning. RAG augments the prompt with the external data, while fine-Tuning incorporates the additional knowledge into the model itself. However, the pros and cons of both approaches are not well understood. In this paper, we propose a pipeline for fine-tuning and RAG, and present the tradeoffs of both for multiple popular LLMs, including Llama2-13B, GPT-3.5, and GPT-4. Our pipeline consists of multiple stages, including extracting information from PDFs, generating questions and answers, using them for fine-tuning, and leveraging GPT-4 for evaluating the results. We propose metrics to assess the performance of different stages of the RAG and fine-Tuning pipeline. We conduct an in-depth study on an agricultural dataset. Agriculture as an industry has not seen much penetration of AI, and we study a potentially disruptive application - what if we could provide location-specific insights to a farmer? Our results show the effectiveness of our dataset generation pipeline in capturing geographic-specific knowledge, and the quantitative and qualitative benefits of RAG and fine-tuning. We see an accuracy increase of over 6 p.p. when fine-tuning the model and this is cumulative with RAG, which increases accuracy by 5 p.p. further. In one particular experiment, we also demonstrate that the fine-tuned model leverages information from across geographies to answer specific questions, increasing answer similarity from 47% to 72%. Overall, the results point to how systems built using LLMs can be adapted to respond and incorporate knowledge across a dimension that is critical for a specific industry, paving the way for further applications of LLMs in other industrial domains.

This paper has not been read by Pith yet.

discussion (0)

Sign in with ORCID, Apple, or X to comment. Anyone can read and Pith papers without signing in.

Forward citations

Cited by 7 Pith papers

Reviewed papers in the Pith corpus that reference this work. Sorted by Pith novelty score.

  1. CARD: Cluster-level Adaptation with Reward-guided Decoding for Personalized Text Generation

    cs.AI 2026-01 unverdicted novelty 7.0

    CARD uses style-based user clustering and implicit preference contrasts to enable efficient personalized text generation via lightweight decoding adjustments on frozen LLMs.

  2. Towards Understanding Continual Factual Knowledge Acquisition of Language Models: From Theory to Algorithm

    cs.CL 2026-05 unverdicted novelty 6.0

    Theoretical analysis of continual factual knowledge acquisition shows data replay stabilizes pretrained knowledge by shifting convergence dynamics while regularization only slows forgetting, leading to the STOC method...

  3. CultivAgents: Cultivating Relationship-Centered Multi-Agent Systems for Personalized Gardening

    cs.HC 2026-05 unverdicted novelty 5.0

    Presents CultivAgents, a relationship-centered multi-agent system for socio-culturally grounded gardening support, with a mixed-methods evaluation showing modest gains in gardener confidence and motivation.

  4. Document Retrieval Augmented Fine-Tuning (DRAFT) for safety-critical software assessments

    cs.SE 2025-05 unverdicted novelty 5.0

    DRAFT fine-tunes LLMs with a dual-retrieval architecture and semi-automated datasets containing distractors to achieve 7% higher correctness in safety compliance assessments.

  5. A Survey on Hallucination in Large Language Models: Principles, Taxonomy, Challenges, and Open Questions

    cs.CL 2023-11 unverdicted novelty 5.0

    The paper surveys hallucination in LLMs with an innovative taxonomy, factors, detection methods, benchmarks, mitigation strategies, and open research directions.

  6. Assessment of RAG and Fine-Tuning for Industrial Question-Answering-Applications

    cs.CL 2026-05 unverdicted novelty 4.0

    RAG is more effective and cost-efficient than fine-tuning for industrial QA adaptation on automotive datasets.

  7. A Survey on Large Language Models for Code Generation

    cs.CL 2024-06 unverdicted novelty 3.0

    A systematic literature review that organizes recent work on LLMs for code generation into a taxonomy covering data curation, model advances, evaluations, ethics, environmental impact, and applications, with benchmark...