Exploring How LLMs Capture and Represent Domain-Specific Knowledge

Mirian Hipolito Garcia, Camille Couturier, Daniel Madrigal Diaz, Ankur Mallick, Anastasios Kyrillidis +3 more
4/23/2025
cs.LG

No confident code implementation found for this paper. 4 possible matches can be shown below.

Abstract

We study whether Large Language Models (LLMs) inherently capture domain-specific nuances in natural language. Our experiments probe the domain sensitivity of LLMs by examining their ability to distinguish queries from different domains using hidden states generated during the prefill phase. We reveal latent domain-related trajectories that indicate the model's internal recognition of query domains. We also study the robustness of these domain representations to variations in prompt styles and sources. Our approach leverages these representations for model selection, mapping the LLM that best matches the domain trace of the input query (i.e., the model with the highest performance on similar traces). Our findings show that LLMs can differentiate queries for related domains, and that the fine-tuned model is not always the most accurate. Unlike previous work, our interpretations apply to both closed and open-ended generative tasks

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 4 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{garcia2025exploring,
  title  = {Exploring How LLMs Capture and Represent Domain-Specific Knowledge},
  author = {Mirian Hipolito Garcia and Camille Couturier and Daniel Madrigal Diaz and Ankur Mallick and Anastasios Kyrillidis and Robert Sim and Victor Ruhle and Saravan Rajmohan},
  year   = {2025},
  eprint = {2504.16871},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2504.16871v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2504.16871.svg)](https://codeofpaper.com/paper/2504.16871)

Discussion