Stories / AI

Testing the behavior of generative AI

Evaluating language-model outputs for a product supporting content creation and profile design.

The client

A company with a product that uses language models to support content creation and profile design, relying on third-party models.

The problem

Language-model outputs vary. The same input can produce different answers that are all acceptable, and an answer can be well formed but wrong. Conventional pass-or-fail testing, which compares output with an expected value, was not enough.

The product needed checks for meaning, format, integration behavior and retained context.

What we did

We combined automated and manual evaluation, and tested the integration around the model as well as the model's output. The main pieces, and why each is there:

  • Automated output checks. Checks that run on every output, including its format, so problems that can be detected by rule are caught without a person reading each response.
  • NLP analysis. Natural language processing with spaCy and NLTK, to look at the content and meaning of outputs rather than exact wording.
  • Manual bias review. People reviewing outputs for bias, which automated checks handle poorly.
  • Integration tests. Tests of response storage and context retention, so the product keeps and reuses earlier context correctly, alongside checks on the health of the third-party models it depends on.

AI output evaluation is part of our QA services and of how we approach AI product engineering. For more on the method, see our post on QA in evaluating LLM output.

The stack

  • Models: third-party LLMs
  • NLP analysis: spaCy, NLTK
  • Evaluation: automated output checks, manual bias review, integration tests

The outcome

The project established a repeatable approach to finding output and integration defects. Its feedback informed model settings and product quality.

In a similar spot?

If “Our AI prototype isn’t ready for real users” sounds like you, tell us. We will reply with what we would do first.

A related story