Papers › Tag-LLM: Repurposing General-Purpose LLMs for Specialized Domains

Tag-LLM: Repurposing General-Purpose LLMs for Specialized Domains

6 Feb 2024arXiv:2402.05140archive 2025-07-28

Junhong Shen, Neil Tenenholtz, James Brian Hall, David Alvarez-Melis, Nicolo Fusi

Large Language Models (LLMs) have demonstrated remarkable proficiency in understanding and generating natural language. However, their capabilities wane in highly specialized domains underrepresented in the pretraining corpus, such as physical and biomedical sciences. This work explores how to repurpose general LLMs into effective task solvers for specialized domains. We introduce a novel, model-agnostic framework for learning custom input tags, which are parameterized as continuous vectors appended to the LLM's embedding layer, to condition the LLM. We design two types of input tags: domain tags are used to delimit specialized representations (e.g., chemical formulas) and provide domain-relevant context; function tags are used to represent specific functions (e.g., predicting molecular properties) and compress function-solving instructions. We develop a three-stage protocol to learn these tags using auxiliary data and domain knowledge. By explicitly disentangling task domains from task functions, our method enables zero-shot generalization to unseen problems through diverse combinations of the input tags. It also boosts LLM's performance in various specialized domains, such as predicting protein or chemical properties and modeling drug-target interactions, outperforming expert models tailored to these tasks.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology: its repositories, every harvested function with whether it ran, its licence and the call to fetch it.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2402.05140")

Code

Syntology Ran 8 of 12 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 1 ran · our draft was wrong; 1 ran · fixture could not drive it; 6 ran with no contract checked.

By repository: official repository: 12 samples from 1 repository, 8 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

sjunhongshen/tag-llm officialmentioned in papermentioned on GitHubpytorch report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

12 samples harvested; 8 ran; 0 honoured the contract we drafted; 4 have no recorded run. Read from Syntology's graph 2026-09-25; that is when this build read the record, not when the samples ran.

1ran · our draft was wrong
1ran · fixture could not drive it
6ran
4unverified

Licence: 12 of the 12 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from sjunhongshen/tag-llm. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

AugmentedTokenEncoder sjunhongshen/tag-llm/src/tag_llama.py official repository ran · metamorphic tier: deterministic no licence file found · pointer only · e518de1c5154e4de · report
TagLlamaRotaryEmbedding sjunhongshen/tag-llm/src/tag_llama.py official repository ran · metamorphic tier: deterministic no licence file found · pointer only · 28d8cd93b790eb3b · report
_expand_mask sjunhongshen/tag-llm/src/tag_llama.py official repository ran · our draft was wrong no licence file found · pointer only · a85227444bd04c75 · report
_make_causal_mask sjunhongshen/tag-llm/src/tag_llama.py official repository ran · fixture could not drive it no licence file found · pointer only · c0290d783d0faae8 · report
drug_target_collate_fn sjunhongshen/Tag-LLM/src/TDCdata.py official repository ran no licence file found · pointer only · e45a97b52b823610 · report
nested_select sjunhongshen/Tag-LLM/src/metrics.py official repository ran no licence file found · pointer only · 330bcd19fcdb2147 · report
simple_basename sjunhongshen/Tag-LLM/src/arguments.py official repository ran fingerprinted no licence file found · pointer only · d73f2cdc8a6da456 · report
strip_special_tokens sjunhongshen/Tag-LLM/src/metrics.py official repository ran fingerprinted no licence file found · pointer only · a76b500245a3c895 · report
TagLlamaAttention sjunhongshen/tag-llm/src/tag_llama.py official repository unverified no licence file found · pointer only · ac1f13679668276b · report
TagLlamaDecoderLayer sjunhongshen/tag-llm/src/tag_llama.py official repository unverified no licence file found · pointer only · cd0950c94372a4e4 · report
TagLlamaModel sjunhongshen/tag-llm/src/tag_llama.py official repository unverified no licence file found · pointer only · 6bfbe95e48d141a0 · report
postprocess_text sjunhongshen/Tag-LLM/src/metrics.py official repository unverified no licence file found · pointer only · 85f31f5811b9b51a · report

Tasks

TAGZero-shot Generalization

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections