SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2404.11055 · 2024

Do LLMs Think Fast and Slow? A Causal Study on Sentiment Analysis

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 6 functions out of this paper's own repositories and ran 5 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
cogito233/causal-sa canonical 5 of 6
FunctionStatusWhere it lives
buildSpanningTree_fromMatrix Ran cogito233/causal-sa/src/discourse/cluster_graph.py
pointer only (licence: NONE) · get_code("e2172b6f7a6f0e09")
find_sub_list Ran cogito233/causal-sa/src/LLM/causal_tracing/tracing.py
pointer only (licence: NONE) · get_code("bd63106a0416368c")
is_stream Ran cogito233/causal-sa/src/discourse/cluster_graph.py
pointer only (licence: NONE) · get_code("86571f3cd37f6c40")
load_from_npy Ran cogito233/causal-sa/src/data_reformated_pipeline/discourse_generate.py
pointer only (licence: NONE) · get_code("b6b60ae704b2912f")
load_from_npy Ran cogito233/causal-sa/src/discourse/cluster_graph.py
pointer only (licence: NONE) · get_code("c7842e8b17798395")
load_similarity_list Not yet run cogito233/causal-sa/src/data_reformated_pipeline/discourse_generate.py
pointer only (licence: NONE) · get_code("c0cd3caa93175ecc")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Sentiment analysis (SA) aims to identify the sentiment expressed in a text, such as a product review. Given a review and the sentiment associated with it, this work formulates SA as a combination of two tasks: (1) a causal discovery task that distinguishes whether a review "primes" the sentiment (Causal Hypothesis C1), or the sentiment "primes" the review (Causal Hypothesis C2); and (2) the traditional prediction task to model the sentiment using the review as input. Using the peak-end rule in psychology, we classify a sample as C1 if its overall sentiment score approximates an average of all the sentence-level sentiments in the review, and C2 if the overall sentiment score approximates an average of the peak and end sentiments. For the prediction task, we use the discovered causal mechanisms behind the samples to improve LLM performance by proposing causal prompts that give the models an inductive bias of the underlying causal graph, leading to substantial improvements by up to 32.13 F1 points on zero-shot five-class SA. Our code is at https://github.com/cogito233/causal-sa

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2404.11055")
get_code_for_paper("2404.11055")
have("2404.11055")

Connect an agent — have() is free.