← Back to articles
Observability

Observability in AI

Imagine flying an airplane without navigation instruments—that is how many teams feel when deploying AI systems into production without a robust observability strategy. And, let's be honest, nobody wants their system to become a ticking time bomb for the company's reputation!


Why is AI observability different?#

In AI systems, knowing whether the system is "online" is not enough. You need to track details such as:

  • Output quality: are the models delivering responses within the expected parameters?

  • Data drift and concept drift: are the models adapting to changes in the data?

  • Dynamic performance: are inferences getting slower over time?

  • Cost and token consumption: are we spending more tokens—and money—than necessary?

Traditional monitoring tools often miss these details—it is like trying to measure temperature with a ruler!


Market Solutions#

To help you choose the ideal tool, see the following comparison table:

Enlarge ↗

Homegrown Solutions: When They Are Worth It#

Sometimes, the best observability system is one tailored to specific use cases. Some successful implementations documented in the industry include:

1. An AI-specific custom ELK pipeline#

An Elasticsearch + Logstash + Kibana stack specifically adapted for AI can capture:

  • Model input versus output data

  • Response times by query type

  • Automatic alerts for statistical drift

  • Sentiment analysis of user interactions

The development cost is significant—typically several months of engineering—but for systems processing millions of daily interactions, the ability to identify specific issues can save substantial amounts in rework and customer dissatisfaction.

2. A quality-evaluation framework based on shadow models#

A system in which a sample of requests is sent simultaneously to:

  • The production model

  • The previous model (reference)

  • A "canary" model (candidate for the next version)

A real-time dashboard can compare responses, identifying:

  • Concerning divergences

  • Potential improvements

  • Cases in which responses fall outside established guardrails

This approach is particularly valuable for identifying critical issues even before new versions are fully deployed.

3. A hybrid log and token-metrics system#

A pipeline that:

  • Records every prompt and response

  • Accounts for token usage by application layer

  • Identifies prompt patterns that consume tokens unnecessarily

  • Traces "chain of thought" in complex inferences

Systems like this have been documented as highly effective at identifying significant waste in token budgets due to redundant contextual information.


Metrics that really matter—but are not always monitored#

Industry specialists highlight frequently overlooked metrics that make all the difference:

1. Uncertainty distribution#

Rather than just average confidence, monitor the entire distribution. An increase in variance is often the first sign of problems, even when averages appear stable.

2. Token consumption rate versus value generated#

A use-case-specific "value per token" index, relating inference cost to the value of the result—measured by NPS, conversion, or specific business metrics—can reveal hidden inefficiencies.

3. Latency broken down by complexity#

Segmenting response times by query complexity often reveals that apparently acceptable degradation in the average is hiding serious problems with certain query types.

4. Semantic distance between versions#

Measuring not only accuracy but also how much responses diverge semantically between model versions can warn of subtle behavioral changes that traditional metrics miss.


Generative-AI-specific metrics that revolutionize monitoring#

MLOps specialists have developed and recommended specialized metrics for generative models that prove critically important:

1. Internal Consistency Index#

Measuring coherence between different parts of the same generated text. A model may produce passages that look good individually but contain internal contradictions or shifts in position throughout the content.

Use case: smaller analysis models can identify contradictory statements within the same text, triggering alerts when the inconsistency rate exceeds an acceptable threshold.

2. Factual Hallucination Rate#

Systems that verify factual claims in generated text against a reliable knowledge base.

Use case: a combination of automated checking for common facts and sampling for human review can identify when virtual assistants are "inventing" historical data or incorrect factual information.

3. Embedding Convergence#

Monitoring whether embeddings of similar documents are converging or diverging over time.

Use case: this metric can reveal when an embedding model is gradually losing the ability to correctly group documents from the same domain, negatively affecting RAG results.

4. Creativity/Accuracy Ratio#

A balanced index that simultaneously measures originality and factual accuracy.

Use case: for creative-content generators, this index can identify when a model sacrifices factuality for creativity after fine-tuning, generating engaging but incorrect text.

5. Instruction-Following Metrics#

Calculating the rate at which the model follows specific instructions provided in prompts.

Use case: in systems generating structured content such as emails, this metric can identify when the model ignores specific instructions about tone and format, especially in long prompts.

6. Actual Temperature Profile#

Measuring the actual diversity of outputs for the same prompt at different temperature settings.

Use case: this analysis can reveal when a fine-tuned model has a narrower effective temperature "band" than expected, producing nearly identical results across different settings.

7. Semantic Reference Distance#

Comparing model outputs not just for correctness but for semantic proximity to reference responses.

Use case: in specialized assistants, such as legal or medical assistants, this metric can identify cases in which responses are technically correct but semantically distant from the communication standard expected in the professional context.

8. Prompt Stability Metrics#

Monitoring how small variations in similar prompts affect response consistency.

Use case: this analysis can identify when a chatbot is extremely sensitive to the order of questions in a prompt, generating significantly different responses after only subtle changes in wording.


Lessons documented in the industry#

Specialists share valuable insights based on real experience:

  1. Monitor beyond averages: there are documented cases of systems with 99% average accuracy in which the 1% of failures were concentrated in a critical VIP-user segment.

  2. Observe multiple layers: incident reports show systems with perfect API metrics hiding serious issues: semantically incorrect but syntactically valid responses.

  3. Instrumentation affects performance: case studies reveal how overly aggressive logging can create additional latency, causing timeouts and creating a vicious cycle of degradation.

  4. Measure the cost of observability: financial analyses of projects show excessively detailed implementations multiplying storage costs several times over, with little tangible return.

  5. Human feedback is irreplaceable: usability studies indicate that in systems where quality evaluation is 100% automated, critical subtleties such as gradual changes in response tone and style are often missed.

  6. Test with adversarial data: post-incident reports demonstrate how RAG systems that are perfect in test environments can fail in production when they receive ambiguous and poorly worded queries.


A three-layer strategy#

Based on multiple case studies and industry best practices, a three-level approach is often recommended:

Enlarge ↗

Conclusion: Invisible monitoring is best#

The best observability systems are like good soccer referees: when they do their job perfectly, we barely notice their presence. But without them, the game becomes impossible.

Investing in AI observability is not a cost—it multiplies the ROI of the entire investment in artificial intelligence. And with generative models, where behavior can be more unpredictable and failures more subtle, that observability becomes even more critical.


Glossary:#

Hallucination: when a generative AI model produces content that appears plausible but contains fabricated or incorrect information not present in the training data.

APM (Application Performance Monitoring): a set of tools that monitor application performance in terms of availability, response time, and resource usage.

BLEU Score: a metric that evaluates translated-text quality by comparing similarity between a model's output and one or more human reference translations.

Chain of Thought: a technique in which the model exposes its reasoning step by step, showing how it arrived at a specific answer.

Concept Drift: a phenomenon in which the meaning of data—the relationship between inputs and outputs—changes over time, even when the data distribution remains constant.

Data Drift: a change in the statistical distribution of input data over time, causing previously trained models to become less accurate.

ELK Stack: a set of tools comprising Elasticsearch (storage and search), Logstash (log processing), and Kibana (data visualization).

Embeddings: numerical representations of data—text, images, and so on—in a high-dimensional vector space that capture semantic relationships among them.

Fine-tuning: the process of adapting a pretrained model to a specific domain or task using additional data.

Guardrails: restrictions or limits imposed on AI models to ensure their responses remain within acceptable safety, quality, or relevance parameters.

Inference: the process of using a trained model to produce results from new input data.

Instruction Following: a model's ability to correctly follow instructions provided in a prompt.

Latency: the time between submitting a request and receiving the corresponding response.

MLOps: a set of practices aimed at automating and operationalizing the lifecycle of machine-learning models.

Model Drift: gradual degradation of a model's performance over time, caused by changes in production data relative to training data.

NPS (Net Promoter Score): a metric measuring customer loyalty and satisfaction based on the likelihood of recommending a product or service.

Observability: the ability to understand a system's internal state based solely on its external outputs, through logs, metrics, and tracing.

Outliers: values that differ significantly from most other values in a dataset.

Prompt: instructions or context provided to a language model to guide content generation.

RAG (Retrieval-Augmented Generation): a technique combining information retrieval from a knowledge base with content generation, allowing models to access information outside their training.

ROI (Return on Investment): the relationship between the profit obtained and the investment made in an initiative.

Semantics: the study of meaning in language; in the AI context, it refers to models' ability to understand content meaning beyond syntax.

Shadow Model: a model running alongside the primary model, used for testing and comparison without affecting the production environment.

SLA (Service Level Agreement): a commitment between a service provider and a client that defines the expected service level.

Temperature: a parameter controlling randomness or creativity in generative-model outputs. Higher values produce more diverse and creative responses, while lower values generate more predictable and deterministic responses.

Throughput: the amount of work a system can process in a given period.

Tokenization: the process of splitting text into smaller units—tokens—for processing by language models.

Tokens: basic text units processed by language models, which may be words, word parts, or individual characters.

Originally published on LinkedIn. View publication ↗