{"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/text-clustering-as-classification-with-llms","title":"Text Clustering as Classification with LLMs","arxiv_id":"2410.00927","date":"2024-09-30","proceeding":null,"authors":["Chen Huang","Guoxiu He"],"abstract":"Text clustering remains valuable in real-world applications where manual labeling is cost-prohibitive. It facilitates efficient organization and analysis of information by grouping similar texts based on their representations. However, implementing this approach necessitates fine-tuned embedders for downstream data and sophisticated similarity metrics. To address this issue, this study presents a novel framework for text clustering that effectively leverages the in-context learning capacity of Large Language Models (LLMs). Instead of fine-tuning embedders, we propose to transform the text clustering into a classification task via LLM. First, we prompt LLM to generate potential labels for a given dataset. Second, after integrating similar labels generated by the LLM, we prompt the LLM to assign the most appropriate label to each sample in the dataset. Our framework has been experimentally proven to achieve comparable or superior performance to state-of-the-art clustering methods that employ embeddings, without requiring complex fine-tuning or clustering algorithms. We make our code available to the public for utilization at https://github.com/ECNU-Text-Computing/Text-Clustering-via-LLM.","url_abs":"https://arxiv.org/abs/2410.00927v2","url_pdf":"https://arxiv.org/pdf/2410.00927v2.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":"text-clustering-as-classification-with-llms","repo_url":"https://github.com/ecnu-text-computing/text-clustering-via-llm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[{"task_slug":"classification-1","task_name":"Classification"},{"task_slug":"clustering","task_name":"Clustering"},{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"text-clustering","task_name":"Text Clustering"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.00927","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.00927"}},"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/ecnu-text-computing/text-clustering-via-llm","reach":null}],"summary":{"ran_draft_wrong":5,"ran_honours":1},"by_repo_kind":{"official":{"samples":6,"ran":6,"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":6,"samples":[{"code_sha256_prefix":"c7c5f4efa80e3754","entry":"chat","repo":"ecnu-text-computing/text-clustering-via-llm","repo_kind":"official","path":"label_generation.py","file_url":"https://github.com/ecnu-text-computing/text-clustering-via-llm/blob/HEAD/label_generation.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c7c5f4efa80e3754"}},{"code_sha256_prefix":"662323909b288697","entry":"get_label_list","repo":"ecnu-text-computing/text-clustering-via-llm","repo_kind":"official","path":"label_generation.py","file_url":"https://github.com/ecnu-text-computing/text-clustering-via-llm/blob/HEAD/label_generation.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"662323909b288697"}},{"code_sha256_prefix":"eb28d781ace53d99","entry":"get_labels","repo":"ecnu-text-computing/text-clustering-via-llm","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/ecnu-text-computing/text-clustering-via-llm/blob/HEAD/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"eb28d781ace53d99"}},{"code_sha256_prefix":"27bcd6e5d0c8f28d","entry":"load_data","repo":"ecnu-text-computing/text-clustering-via-llm","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/ecnu-text-computing/text-clustering-via-llm/blob/HEAD/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"27bcd6e5d0c8f28d"}},{"code_sha256_prefix":"f91ff363c2d7e522","entry":"load_dataset","repo":"ecnu-text-computing/text-clustering-via-llm","repo_kind":"official","path":"label_generation.py","file_url":"https://github.com/ecnu-text-computing/text-clustering-via-llm/blob/HEAD/label_generation.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"f91ff363c2d7e522"}},{"code_sha256_prefix":"909c1cfaf88b8a13","entry":"load_predict_data","repo":"ecnu-text-computing/text-clustering-via-llm","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/ecnu-text-computing/text-clustering-via-llm/blob/HEAD/evaluate.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"909c1cfaf88b8a13"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}