Papers › HYDRA: Model Factorization Framework for Black-Box LLM Personalization

HYDRA: Model Factorization Framework for Black-Box LLM Personalization

5 Jun 2024arXiv:2406.02888archive 2025-07-28

Yuchen Zhuang, Haotian Sun, Yue Yu, Rushi Qiang, Qifan Wang, Chao Zhang, Bo Dai

Personalization has emerged as a critical research area in modern intelligent systems, focusing on mining users' behavioral history and adapting to their preferences for delivering tailored experiences. Despite the remarkable few-shot capabilities exhibited by black-box large language models (LLMs), the inherent opacity of their model parameters presents significant challenges in aligning the generated output with individual expectations. Existing solutions have primarily focused on prompt design to incorporate user-specific profiles and behaviors; however, such approaches often struggle to generalize effectively due to their inability to capture shared knowledge among all users. To address these challenges, we propose HYDRA, a model factorization framework that captures both user-specific behavior patterns from historical data and shared general knowledge among all users to deliver personalized generation. In order to capture user-specific behavior patterns, we first train a reranker to prioritize the most useful information from top-retrieved relevant historical records. By combining the prioritized history with the corresponding query, we train an adapter to align the output with individual user-specific preferences, eliminating the reliance on access to inherent model parameters of black-box LLMs. Both the reranker and the adapter can be decomposed into a base model with multiple user-specific heads, resembling a hydra. The base model maintains shared knowledge across users, while the multiple personal heads capture user-specific preferences. Experimental results demonstrate that HYDRA outperforms existing state-of-the-art prompt-based methods by an average relative improvement of 9.01% across five diverse personalization tasks in the LaMP benchmark. Our implementation is available at https://github.com/night-chen/HYDRA.

PaperPDFCodeCode Syntology ran

In Syntology 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="2406.02888")

Code

Syntology Ran 16 of 16 code samples harvested from 1 repository linked to this paper; 0 have no recorded run. Of those that ran: 6 ran · our draft was wrong; 10 ran with no contract checked.

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

night-chen/hydra 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

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

6ran · our draft was wrong
10ran

Licence: 16 of the 16 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 night-chen/hydra. “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.

LongformerForPersonalizedCls night-chen/hydra/adapter/trainer/personalized_trainer.py official repository ran no licence file found · pointer only · da25fbe823b3c54e · report
LongformerPersonalizedClsHead night-chen/hydra/adapter/trainer/personalized_trainer.py official repository ran · metamorphic tier: deterministic no licence file found · pointer only · 2b0e9e1de87f7100 · report
LongformerSequenceClassifierOutput night-chen/hydra/adapter/trainer/personalized_trainer.py official repository ran · metamorphic tier: deterministic no licence file found · pointer only · 8da550fed680318d · report
api_key_list night-chen/HYDRA/utils/credentials.py official repository ran no licence file found · pointer only · 78978cd98b44b675 · report
extract_after_article night-chen/HYDRA/prompts/utils.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · 3c022e0b56a5b9aa · report
extract_after_description night-chen/HYDRA/prompts/utils.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · 490005de8edac2a7 · report
extract_numbers night-chen/HYDRA/metrics/classification_metrics.py official repository ran fingerprinted no licence file found · pointer only · 128a6ca41173c482 · report
extract_strings_between_quotes night-chen/HYDRA/prompts/utils.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · f11dc768dc0cbefb · report
get_data night-chen/HYDRA/utils/util.py official repository ran no licence file found · pointer only · 4b094583baf62f2f · report
get_personalize_data night-chen/HYDRA/utils/util.py official repository ran no licence file found · pointer only · 1a267a44dd55b79b · report
load_config night-chen/HYDRA/utils/util.py official repository ran no licence file found · pointer only · 159282975f5b3801 · report
mean_pooling night-chen/HYDRA/prompts/contriever_retriever.py official repository ran · our draft was wrong fingerprinted no licence file found · pointer only · fe0e2df4d9cb5edd · report
postprocess_text night-chen/HYDRA/metrics/generation_metrics.py official repository ran · our draft was wrong no licence file found · pointer only · 8b51adb8a6c014e5 · report
postprocess_text_cls night-chen/HYDRA/metrics/classification_metrics.py official repository ran no licence file found · pointer only · 33df4a8be7151fcc · report
postprocess_text_reg night-chen/HYDRA/metrics/classification_metrics.py official repository ran no licence file found · pointer only · 21eed1ab0d4f98f7 · report
prepare_prompts night-chen/HYDRA/adapter/generate/generate.py official repository ran · our draft was wrong no licence file found · pointer only · a5c4afa103aa6d76 · report

Tasks

General Knowledge

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

ALIGNAdapterBASEHydra

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