{"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/manipulating-large-language-models-to","title":"Manipulating Large Language Models to Increase Product Visibility","arxiv_id":"2404.07981","date":"2024-04-11","proceeding":null,"authors":["Aounon Kumar","Himabindu Lakkaraju"],"abstract":"Large language models (LLMs) are increasingly being integrated into search engines to provide natural language responses tailored to user queries. Customers and end-users are also becoming more dependent on these models for quick and easy purchase decisions. In this work, we investigate whether recommendations from LLMs can be manipulated to enhance a product's visibility. We demonstrate that adding a strategic text sequence (STS) -- a carefully crafted message -- to a product's information page can significantly increase its likelihood of being listed as the LLM's top recommendation. To understand the impact of STS, we use a catalog of fictitious coffee machines and analyze its effect on two target products: one that seldom appears in the LLM's recommendations and another that usually ranks second. We observe that the strategic text sequence significantly enhances the visibility of both products by increasing their chances of appearing as the top recommendation. This ability to manipulate LLM-generated search responses provides vendors with a considerable competitive advantage and has the potential to disrupt fair market competition. Just as search engine optimization (SEO) revolutionized how webpages are customized to rank higher in search engine results, influencing LLM recommendations could profoundly impact content optimization for AI-driven search services. Code for our experiments is available at https://github.com/aounon/llm-rank-optimizer.","url_abs":"https://arxiv.org/abs/2404.07981v2","url_pdf":"https://arxiv.org/pdf/2404.07981v2.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":"manipulating-large-language-models-to","repo_url":"https://github.com/aounon/llm-rank-optimizer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"sts","task_name":"STS"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.07981","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.07981"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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/aounon/llm-rank-optimizer","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":7},"by_repo_kind":{"official":{"samples":7,"ran":7,"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":"3f47190c670db8f7","entry":"create_rank_list","repo":"aounon/llm-rank-optimizer","repo_kind":"official","path":"plot/plot_dist.py","file_url":"https://github.com/aounon/llm-rank-optimizer/blob/HEAD/plot/plot_dist.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":"3f47190c670db8f7"}},{"code_sha256_prefix":"3ff68c023b8c0dff","entry":"decode_adv_prompt","repo":"aounon/llm-rank-optimizer","repo_kind":"official","path":"tools.py","file_url":"https://github.com/aounon/llm-rank-optimizer/blob/HEAD/tools.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":"3ff68c023b8c0dff"}},{"code_sha256_prefix":"917ac97cb67e17b3","entry":"get_nonascii_toks","repo":"aounon/llm-rank-optimizer","repo_kind":"official","path":"tools.py","file_url":"https://github.com/aounon/llm-rank-optimizer/blob/HEAD/tools.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":"917ac97cb67e17b3"}},{"code_sha256_prefix":"aa46ad7086cd0ba0","entry":"prompt_generator_llama","repo":"aounon/llm-rank-optimizer","repo_kind":"official","path":"rank_opt.py","file_url":"https://github.com/aounon/llm-rank-optimizer/blob/HEAD/rank_opt.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":"aa46ad7086cd0ba0"}},{"code_sha256_prefix":"f31668c61a9bbb09","entry":"prompt_generator_vicuna","repo":"aounon/llm-rank-optimizer","repo_kind":"official","path":"rank_opt.py","file_url":"https://github.com/aounon/llm-rank-optimizer/blob/HEAD/rank_opt.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":"f31668c61a9bbb09"}},{"code_sha256_prefix":"3f1ad7b766b2b495","entry":"rank_products","repo":"aounon/llm-rank-optimizer","repo_kind":"official","path":"rank_opt.py","file_url":"https://github.com/aounon/llm-rank-optimizer/blob/HEAD/rank_opt.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":"3f1ad7b766b2b495"}},{"code_sha256_prefix":"9ecf44a5744c0c2a","entry":"target_loss","repo":"aounon/llm-rank-optimizer","repo_kind":"official","path":"tools.py","file_url":"https://github.com/aounon/llm-rank-optimizer/blob/HEAD/tools.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":"9ecf44a5744c0c2a"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}