{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/style-vectors-for-steering-generative-large","title":"Style Vectors for Steering Generative Large Language Model","arxiv_id":"2402.01618","date":"2024-02-02","proceeding":null,"authors":["Kai Konen","Sophie Jentzsch","Diaoulé Diallo","Peer Schütt","Oliver Bensch","Roxanne El Baff","Dominik Opitz","Tobias Hecking"],"abstract":"This research explores strategies for steering the output of large language models (LLMs) towards specific styles, such as sentiment, emotion, or writing style, by adding style vectors to the activations of hidden layers during text generation. We show that style vectors can be simply computed from recorded layer activations for input texts in a specific style in contrast to more complex training-based approaches. Through a series of experiments, we demonstrate the effectiveness of activation engineering using such style vectors to influence the style of generated text in a nuanced and parameterisable way, distinguishing it from prompt engineering. The presented research constitutes a significant step towards developing more adaptive and effective AI-empowered interactive systems.","url_abs":"https://arxiv.org/abs/2402.01618v1","url_pdf":"https://arxiv.org/pdf/2402.01618v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"style-vectors-for-steering-generative-large","repo_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"language-modeling","task_name":"Language Modeling"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"prompt-engineering","task_name":"Prompt Engineering"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2402.01618","atlas_url":"https://app.syntology.ai/?focus=2402.01618","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.01618"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/dlr-sc/style-vectors-for-steering-llms","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":7,"ran_draft_wrong":1,"unverified":4},"by_repo_kind":{"official":{"samples":12,"ran":8,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"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"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"33c601ebd0d6a447","entry":"adapt_df","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"utils/evaluation_helper.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/utils/evaluation_helper.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"33c601ebd0d6a447"}},{"code_sha256_prefix":"7e6d12ac4f3a1a63","entry":"adapt_df_plot","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"utils/evaluation_helper.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/utils/evaluation_helper.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7e6d12ac4f3a1a63"}},{"code_sha256_prefix":"6836652221387f57","entry":"check_path","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"utils/dataset_loader.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/utils/dataset_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6836652221387f57"}},{"code_sha256_prefix":"0c540da8d3df6b6e","entry":"compute_intermediate_size","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"utils/convert_llama_weights_to_hf.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/utils/convert_llama_weights_to_hf.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0c540da8d3df6b6e"}},{"code_sha256_prefix":"0ed4db56f772b47e","entry":"goemo_get_only_ekman","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"utils/data_prep.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/utils/data_prep.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0ed4db56f772b47e"}},{"code_sha256_prefix":"3e322054e0f29cdf","entry":"load_activations_goemo","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"utils/steering_vector_loader.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/utils/steering_vector_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3e322054e0f29cdf"}},{"code_sha256_prefix":"a841a4f3727f14d5","entry":"load_trained_vectors_yelp","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"utils/steering_vector_loader.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/utils/steering_vector_loader.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a841a4f3727f14d5"}},{"code_sha256_prefix":"c5bcf01d18bba63d","entry":"read_json","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"utils/convert_llama_weights_to_hf.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/utils/convert_llama_weights_to_hf.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c5bcf01d18bba63d"}},{"code_sha256_prefix":"96cffb1973d6bf56","entry":"load_llm_model","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"utils/llm_model_utils.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/utils/llm_model_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"96cffb1973d6bf56"}},{"code_sha256_prefix":"36a7b7ac7a958d29","entry":"meta_load","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"utils/dataset_loader.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/utils/dataset_loader.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"36a7b7ac7a958d29"}},{"code_sha256_prefix":"111030aec8cc5f8a","entry":"optuna_hp_space","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"shakespeare_classifier/experiments_config.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/shakespeare_classifier/experiments_config.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"111030aec8cc5f8a"}},{"code_sha256_prefix":"cfeea96bf995824a","entry":"write_model","repo":"dlr-sc/style-vectors-for-steering-llms","repo_kind":"official","path":"utils/convert_llama_weights_to_hf.py","file_url":"https://github.com/dlr-sc/style-vectors-for-steering-llms/blob/HEAD/utils/convert_llama_weights_to_hf.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cfeea96bf995824a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}