{"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/large-language-models-can-be-zero-shot","title":"Large language models can be zero-shot anomaly detectors for time series?","arxiv_id":"2405.14755","date":"2024-05-23","proceeding":null,"authors":["Sarah Alnegheimish","Linh Nguyen","Laure Berti-Equille","Kalyan Veeramachaneni"],"abstract":"Recent studies have shown the ability of large language models to perform a variety of tasks, including time series forecasting. The flexible nature of these models allows them to be used for many applications. In this paper, we present a novel study of large language models used for the challenging task of time series anomaly detection. This problem entails two aspects novel for LLMs: the need for the model to identify part of the input sequence (or multiple parts) as anomalous; and the need for it to work with time series data rather than the traditional text input. We introduce sigllm, a framework for time series anomaly detection using large language models. Our framework includes a time-series-to-text conversion module, as well as end-to-end pipelines that prompt language models to perform time series anomaly detection. We investigate two paradigms for testing the abilities of large language models to perform the detection task. First, we present a prompt-based detection method that directly asks a language model to indicate which elements of the input are anomalies. Second, we leverage the forecasting capability of a large language model to guide the anomaly detection process. We evaluated our framework on 11 datasets spanning various sources and 10 pipelines. We show that the forecasting method significantly outperformed the prompting method in all 11 datasets with respect to the F1 score. Moreover, while large language models are capable of finding anomalies, state-of-the-art deep learning models are still superior in performance, achieving results 30% better than large language models.","url_abs":"https://arxiv.org/abs/2405.14755v3","url_pdf":"https://arxiv.org/pdf/2405.14755v3.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":"large-language-models-can-be-zero-shot","repo_url":"https://github.com/sintel-dev/sigllm","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"anomaly-detection","task_name":"Anomaly Detection"},{"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":"time-series-1","task_name":"Time Series"},{"task_slug":"time-series-anomaly-detection","task_name":"Time Series Anomaly Detection"},{"task_slug":"time-series-forecasting","task_name":"Time Series Forecasting"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.14755","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.14755"}},"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/sintel-dev/sigllm","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":5},"by_repo_kind":{"official":{"samples":5,"ran":5,"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":"5f82b97ecdb35e56","entry":"aggregate_rolling_window","repo":"sintel-dev/sigllm","repo_kind":"official","path":"sigllm/primitives/postprocessing.py","file_url":"https://github.com/sintel-dev/sigllm/blob/HEAD/sigllm/primitives/postprocessing.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":"5f82b97ecdb35e56"}},{"code_sha256_prefix":"cb7c5fba03e9fff3","entry":"download_normal","repo":"sintel-dev/sigllm","repo_kind":"official","path":"sigllm/data.py","file_url":"https://github.com/sintel-dev/sigllm/blob/HEAD/sigllm/data.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":"cb7c5fba03e9fff3"}},{"code_sha256_prefix":"776fb35810b9a90f","entry":"format_as_integer","repo":"sintel-dev/sigllm","repo_kind":"official","path":"sigllm/primitives/transformation.py","file_url":"https://github.com/sintel-dev/sigllm/blob/HEAD/sigllm/primitives/transformation.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":"776fb35810b9a90f"}},{"code_sha256_prefix":"4c55324a251b3b8d","entry":"format_as_string","repo":"sintel-dev/sigllm","repo_kind":"official","path":"sigllm/primitives/transformation.py","file_url":"https://github.com/sintel-dev/sigllm/blob/HEAD/sigllm/primitives/transformation.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":"4c55324a251b3b8d"}},{"code_sha256_prefix":"4cccea84f5dd431b","entry":"outliers","repo":"sintel-dev/sigllm","repo_kind":"official","path":"sigllm/primitives/postprocessing.py","file_url":"https://github.com/sintel-dev/sigllm/blob/HEAD/sigllm/primitives/postprocessing.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":"4cccea84f5dd431b"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}