NEWS

6 min read

Dell fine-tuned open-source embedding model to fix RAG search broken by internal terms

Dell fine-tuned open-source embedding model to fix RAG search broken by internal terms
Image: Redação iMasters
News
Reading
6 min
In short

In a presentation at QCon AI, Distinguished Engineer Rachel Shalom detailed how Dell's internal search team diagnosed and fixed RAG retrieval failures on internal acronyms and products by fine-tuning an open-source embedding model.

The problem: search that fails in the company's "language"

Dell maintains an internal agentic search system that connects employees to GitHub, Jira, Confluence, SharePoint, GitLab, and corporate databases. Rachel Shalom, an applied AI scientist and Distinguished Engineer at the company, leads this project and detailed the behind-the-scenes work in a presentation at QCon AI, published by InfoQ.

The team noticed a specific failure pattern: questions about Dell's internal products and acronyms, such as PowerScale, CloudIQ, and PowerProtect, were not returning the correct answers. The system uses semantic search with an off-the-shelf embedding model, and Shalom's hypothesis was simple: the model didn't truly understand the company's internal vocabulary.

Embeddings are the bridge between words and numbers: they capture the meaning of sentences and place them as vectors in a space where similar concepts sit close together. A model trained mostly on public text (Wikipedia, books, open repositories) learns the general language well, but not necessarily the jargon of a specific company, full of abbreviations and product names that don't appear on the open internet.

How embedding models are trained, in two phases

Every embedding model goes through two training phases. The first is pre-training, done on what Shalom calls a "chunk of the internet": Wikipedia, books, public GitHub repositories, a huge amount of text, not always of high quality. The technique used here is usually masked language modeling: the model receives a sentence with a hidden word and learns to guess what it is, gaining a sense of grammar and how words connect.

This phase gives the model a general understanding of language, but not the fine-grained understanding of each term's semantic meaning in a specific domain. That's what the second phase, fine-tuning, is for, which requires high-quality data and is usually more expensive and time-consuming to prepare than pre-training. It was in this second phase that Dell stepped in.

Before training, Dell checked whether it was worth it

Fine-tuning an embedding model costs time and money in quality data collection. That's why, before deciding to train, Shalom's team ran a diagnostic: is Dell's data similar to what the open-source model had already seen during pre-training?

One of the tests was counting unknown tokens that the model's vocabulary, of about 30,000 entries, didn't recognize. The result was surprising: most of the unseen tokens were Base64 strings, box-drawing Unicode characters, checkmark symbols, and long camelCase words, noise with no semantic value, not genuine Dell terminology.

If most of the tokens that I have in my data do not exist in the model vocabulary, that's a reason to start training from scratch, not fine-tuning.

Rachel Shalom, Distinguished Engineer at Dell

Since the percentage of genuinely unknown tokens was small, the conclusion was that fine-tuning was enough: there was no need to train a model from scratch. This vocabulary test is, in practice, a replicable checklist before any company decides to spend GPU resources on embedding training.

Contrastive learning and the InfoNCE loss

The fine-tuning method used by Dell is contrastive learning, today the industry standard for adjusting embedding models. The recipe: assemble example triplets, a question (anchor), a correct answer (positive), and a wrong answer (negative), and train the model to bring the anchor and positive vectors closer together while pushing the negative away.

The loss function used is InfoNCE (Info Noise Contrastive Estimation). In practical terms, it compares the cosine similarity between the question and the correct answer against the similarity between the same question and all the wrong answers in the batch, pushing positives closer and negatives farther apart in the vector space, batch after batch.

The presentation mentions that training ran in a distributed fashion on H100 GPUs, with automatic hyperparameter tuning and production evaluation using LLM-as-a-judge, another language model judging the quality of the fine-tuned embedding's retrievals before it went into production.

The prefix trick for conflicting tasks

A technical detail the presentation highlights is the problem of the "conflicting reward signal." The same embedding model often serves multiple tasks, question-answer retrieval, text clustering, classification, and each task defines similarity differently.

The example given by Shalom: for the sentence "what is the capital of France," an answer like "which countries border France" is more similar if the task is clustering (grouping similar questions). Meanwhile, "Paris" is more similar if the task is question-answering. The adopted solution is to add task prefixes to the text before generating the embedding, something like search_query: and search_document: for retrieval, signaling to the model which notion of similarity to use at that moment.

Criteria for choosing the base model

Before fine-tuning anything, Dell applies a checklist to choose the starting open-source model, designed for a company that cannot touch a model without legal approval:

  • Licensing and commercial use: no model goes into production without approval from the company's legal department
  • Degree of real openness: having published weights isn't enough; ideally the training code and the data used should also be available
  • Benchmarks on the right task: look at leaderboards specific to document retrieval, not just any generic task
  • Inference cost and latency: how fast the model responds in production
  • Multilingual support: relevant if the company operates in more than one language
  • Context size: how much text fits at once in the model's input

Where this runs in practice

The fine-tuned embedding powers a multi-agent architecture with a central supervisor routing questions to agents specialized in GitHub, GitLab, Confluence, security (which queries CVEs from distributions like Ubuntu and SUSE), and databases. Each agent talks only to the supervisor, never to each other, to keep the context lean.

Everything runs on-prem on Dell's own infrastructure, with embeddings stored in pgvector and reprocessed every two days to keep up with changes in Confluence, Jira, and GitHub. Data ingestion detects tables, filters out noise (emojis, irrelevant attachments), and uses AST to generate semantic code chunks, preserving context that a naive cut by text size would lose. The system is also available as a skill and MCP inside Windsurf and Claude Code, and uses Langfuse for observability.

What remains open

The presentation doesn't detail the size of the training dataset, how many question-answer pairs were collected, or the numerical gains in search accuracy after fine-tuning. These points would be covered in the rest of the talk, which the material received does not cover.

What can already be taken away: the vocabulary diagnostic (counting unknown tokens) is cheap and serves as a first step before deciding between fine-tuning and training from scratch. The base model selection checklist avoids legal rework later. And the prefix trick solves a real problem for any embedding model used for more than one task at a time, not just Dell's case.

Translated from the Brazilian Portuguese original · Read the original