Observe, initiate, build, share, repeat.

LLMs: time to stop coding blindly? TDD to the rescue!

Published 18/11/2024

Introduction:

The application of Test Driven Development (TDD) principles to Large Language Models (LLMs) is often overlooked, under the pretext that it is neither possible nor profitable. However, TDD can bring significant benefits in terms of reliability, security, and performance.

Objective:

This presentation aims to demonstrate how TDD can be applied to LLMs to:

  • Guarantee the reliability and security of systems.
  • Evaluate and improve overall performance.
  • Reduce production costs.
  • Perform benchmarks across multiple LLMs.

Content:

I will share my experience at Orange Business on a client project, where we developed a chatbot for citizens of a city. We implemented a multi-agent system using several LLM models, while applying a TDD strategy.

Technical Details:

  • Types of tests used: unit tests, integration tests.
  • Tools and frameworks: Promptfoo (equivalent to a baby Pytest or Jest), Langchain
  • Integration of tests in the development pipeline: GitLab CI

Conclusion:

TDD can transform the way we develop and deploy LLM-based systems, bringing benefits both in terms of quality and performance.