One Word Is Worth a Thousand: Adversarial Attacks on Tweets Can Deceive Stock PredictionA Word is Worth A Thousand Dollars: Adversarial Attack on Tweets Fools Stock Predictions
The authors propose a concatenation-style adversarial tweet attack on three stock prediction models, and the authors state that a single quote tweet with a single-word replacement can cause 23%–32% additional loss in simulated investment.
The attacker cannot modify others' tweets (manipulation attack does not apply) and can only publish semantically similar adversarial tweets as quote tweets injected into the data stream (concatenation attack); the victim system is a stock direction prediction model that takes a set of tweets and numerical factors as input; the attack is untargeted, and the goal is to flip originally correct predictions.
- More and more investors and models use social media tweets to predict stock prices, but whether such models are as susceptible to adversarial attacks as ordinary text models has been little studied; anyone can post tweets to influence model inputs, so the risk is real.
- The authors propose a concatenating attack: instead of modifying the original tweet, post a perturbed but semantically similar quote tweet injected into the input; model tweet selection, word selection and replacement as a combinatorial optimization with semantic and budget constraints, solved with two solvers, JO and AGO.
- On Stocknet, FinGRU, and FinLSTM, with a budget of 1 each, ASR is 11.8%–19.7% (Table 1); the authors state that in trading simulation, a quote tweet with a single-word replacement can cause 23%–32% additional loss.
- The authors state they hope to develop more robust human-in-the-loop architectures in the future to address black-box attacks, unknown input domains, etc. (Conclusion). The experiments cover only three models and one dataset, with a maximum ASR of 19.7%, and the paper does not report human evaluation or statistical tests.
- Evaluated models
- StocknetFinGRUFinLSTM
- Benchmarks
- Xu and Cohen (2018) 股票预测数据集(88 支股票、10,824 实例、57,533 条推文)
- Metrics
- ASRF1PnL
The researchers propose an adversarial attack method that can deceive stock prediction models simply by perturbing tweets. The method formulates the generation of adversarial tweets as a combinatorial optimization problem with semantic and budget constraints, requiring only appending one perturbed but semantically similar tweet after the original tweet. On three stock prediction models, the attack achieves stable success rates and causes significant financial losses in trading simulations.
Paper analysis
What problem does this paper attempt to solve?
Investigating whether stock prediction models are vulnerable to adversarial attacks: can an attacker flip predictions and cause trading losses solely by posting semantically similar tweets?
Core question: Do stock prediction models based on social media data such as tweets also have adversarial example vulnerability, and can an attacker carry out an attack by injecting new tweets when they cannot modify others' tweets?
- Scenario and motivation: More and more investors and models rely on social media information such as Twitter and Reddit to predict stock price movements; the authors cite the 2013 incident in which the Associated Press account was hacked and posted false news, briefly wiping out market value, and argue that the risk is real when media information is used for trading decisions.
- Existing gaps: The authors state that deep text models are known to be vulnerable to adversarial attacks, but similar vulnerability of stock prediction models is still underexplored; and most attacks directly modify benign text (manipulation attacks), which does not match the reality that malicious users cannot modify others' tweets.
- Core idea: Model the attack as a text-concatenating attack—injecting a perturbed but semantically similar new tweet in the form of a quote tweet, so that it passes the model's tweet filtering and enters the inference corpus; the generation task is modeled as a combinatorial optimization with semantic and budget constraints.
- Paper contributions: Proposes an attack method with hierarchical perturbation (tweet selection, word selection, word perturbation) and two solvers, JO and AGO, evaluated on three financial forecasting models with ASR, F1 and trading profit and loss; the authors describe it as an early work in the financial NLP literature to consider adversarial attacks.
- Threat model:
- Goal: untargeted attack, flipping the victim model's originally correct direction prediction (up/down).
- Knowledge: The paper does not explicitly define this in white-box/black-box terms; the solvers use gradients (PGD) for optimization, and the appendix states that the attack loss uses cross-entropy.
- Capability: Can only post new tweets (quote tweets), cannot modify existing tweets; numerical factors are treated as non-attackable.
- Victim system: A multimodal stock direction prediction model that takes a set of tweets and numerical factors as input.
What related research exists?
Related work falls into four groups: financial deep learning forecasting, textual adversarial attacks, concatenating attacks, and combinatorial-optimization-based attack generation.
Deep Learning Prediction in Finance
- Ding et al. (2015), Hiew et al. (2019), Sawhney et al. (2021), etc.—use CNN, RNN, LSTM, GNN, transformer, autoencoder, etc. for event-driven or sentiment-driven stock price prediction; Xu and Cohen (2018) propose Stocknet, which predicts stock movement from tweets and historical prices, and is the source of the victim model and dataset in this paper.
- Antweiler and Frank (2004), Cookson and Niessner (2020)—find that sentiment disagreement in Yahoo Finance comments and Stocktwits is related to market activity, which the authors use to explain the usefulness of social media information for prediction.
Text Adversarial Attacks
- Szegedy et al. (2014), Goodfellow et al. (2015)—pioneering work on adversarial examples, which the authors use to introduce the vulnerability of text models.
- Sentence-level attacks: Xu et al. (2021), Iyyer et al. (2018), Ribeiro et al. (2018); word-level attacks: Zhang et al. (2019), Alzantot et al. (2018), Zang et al. (2020), Jin et al. (2020), Lei et al. (2019), etc.; both: Chen et al. (2021). The paper only describes them and does not compare them one by one.
Concatenation Attacks
- Jia and Liang (2017)—concatenation-style adversarial examples for reading comprehension systems, which inspired the task formulation in this paper.
- Le et al. (2021), Song et al. (2021), Wang et al. (2020)—the authors state that literature on concatenation attacks on classification models is scarce and these papers are exceptions; this paper provides additional evidence on the difference between concatenation and manipulation attacks through experiments in the financial domain.
Combinatorial-Optimization-Based Attack Generation and Solving
- Zang et al. (2020), Guo et al. (2021)—model word-level attacks as combinatorial optimization, an approach this paper follows.
- Srikant et al. (2021)—convex relaxation (convex hull) method, on which the JO/AGO solvers in this paper are built; Appendix D reports that in this paper's experiments loss smoothing did not reproduce its benefit in Srikant et al. (2021).
- Word importance criteria: Alzantot et al. (2018) use predicted probability, Ren et al. (2019) use probability-weighted word saliency, Jin et al. (2020) use the prediction change before and after deletion, for AGO's greedy search to use.
Baselines and Benchmarks: the baselines are no attack (NA) and random attack (RA); the benchmark is the Xu and Cohen (2018) stock prediction dataset. Authors' positioning: this paper is an earlier work introducing adversarial attacks into financial NLP, and it adopts the more realistic concatenation setting rather than modifying the original source.
How does the paper address this problem?
The attack is modeled as hierarchical combinatorial optimization (selecting tweets, selecting words, selecting replacement words), solved with JO using convex relaxation plus PGD and AGO using alternating greedy search.
Overall approach: use hierarchical perturbation to generate adversarial quote tweets—first select the target tweet, then select the words in it to perturb, and finally replace or delete them with GLOVE synonyms, so that the injected tweet is semantically similar and can fool manual review and platform content moderation.
Problem setting and formalization
- The victim model f takes a set of tweets ct and numerical factors pt as input and outputs a direction prediction ŷ(t+1) ∈ {−1, 1}, where h is the lookback window; numerical factors are treated as non-attackable.
- Perturbation formula c′t = (1 − m · z) · ct + m · z · u · S(ct): boolean vector m selects tweets, z selects words, u selects replacement words, and S is an element-wise synonym generation function; the meaning is to replace only the selected words of the selected tweets.
- The optimization objective is to minimize the attack loss L (cross-entropy for untargeted attacks), subject to a tweet budget 1ᵀm ≤ bs, a word budget 1ᵀzi ≤ bw, and exactly one replacement selected per word 1ᵀui,j = 1; the perturbation is applied only on the attack day t, preserving the time order.
- Deletion perturbation is treated as a special case of replacement (replacing with a padding token); an entropy regularizer is added to encourage sparse variables.
Solver JO
- Relax the boolean variables to a continuous space and optimize with gradients over the convex hull; u is optimized over the convex hull after softmax, and m and z are optimized directly with projected gradient descent (PGD).
- During optimization, all collected tweets are added to the set to backpropagate gradients; afterward, the top bs tweets by m are mapped back to one-hot.
Solver AGO
- Alternately optimize m, z and u: u still uses the convex hull method, while tweet and word selection switch to greedy search—simulating a physical attack scenario, adding new quote tweets to the set during search and selecting the tweets and words that increase the prediction loss the most.
- The authors state that the greedy method has a large query volume when there are many tweets and the budget is large, and alternating optimization is used to alleviate computational inefficiency; word importance can use criteria such as prediction probability, probability-weighted word salience, or the change in prediction before and after deletion.
Success criteria and evaluation method
- Attacks are carried out only on test instances that the victim model originally predicted correctly; ASR is the proportion of attacks that change the model output, and F1 measures the performance drop after the attack.
- A Long-Only Buy-Hold-Sell strategy is also used for trading simulation: initial net value $10,000, buy and hold for one day if the prediction is up, and the change in PnL measures the monetary impact of the attack.
What experiments did the paper conduct?
ASR and F1 of replacement/deletion perturbations are evaluated on three models, and experiments on budget, iterations, manipulation comparison, and trading simulation are conducted.
Experimental Setup
- Models evaluated: Stocknet (VAE architecture, trained from scratch), FinGRU, FinLSTM (the latter two reuse Stocknet's Market Information Encoder, using GRU/LSTM with attention respectively, Adam optimizer, learning rate 0.005, taking the best checkpoint on the test set within 100 epochs).
- Dataset: Xu and Cohen (2018) stock prediction dataset, 88 stocks, 9 industries, 2014-01-01 to 2016-01-01, 10,824 instances in total, 57,533 tweets; small fluctuations were filtered by ±0.55%/−0.5% thresholds and classes were balanced; rolling splits yielded 9,416 training and 1,408 test instances (7 non-contiguous periods).
- Baselines: no attack (NA) and random attack (RA).
- Metrics: ASR (the proportion of originally correct predictions flipped by the attack), post-attack F1, trading simulation PnL (initial $10,000).
- Review method: no LLM or human review; attack success is determined automatically by model output flips.
- Samples and repetitions: the attack is applied only to correctly classified instances in the test set; the paper does not report the number of repetitions.
Main Results
Table 1 (replacement perturbation, tweet and word budgets both 1):
Swipe horizontally to read the table
Model RA ASR JO ASR AGO ASR RA F1 JO F1 AGO F1 Stocknet 4.5% 16.8% 11.8% 0.96 0.84 0.88 FinGRU 5.1% 16.4% 14.1% 0.95 0.85 0.87 FinLSTM 11.9% 16.5% 19.7% 0.89 0.85 0.78 (Under NA, ASR is 0 and F1 is 1, according to Table 1.)
- The authors state that JO and AGO achieve ASR on average about 10% higher than random attack and F1 on average about 0.1 lower, and consider this drop substantial given daily prediction accuracy of about 60%.
- The authors state that a single-tweet, single-word budget is the most cost-effective: the perturbation is smallest while ASR approaches that of higher budgets.
Deletion Perturbation Comparison (Table 2)
- With deletion perturbation and budgets of 1 each, ASR is overall lower: Stocknet JO 12.1%/AGO 11.0%, FinGRU JO 10.2%/AGO 10.6%, FinLSTM JO 12.1%/AGO 11.6%.
- The authors state that ASR for JO and AGO decreases by 5.1% and 4.1% respectively compared with replacement perturbation, with F1 slightly higher accordingly; under the deletion setting the two solvers differ little, and JO is preferable in optimization efficiency.
Manipulation Attack vs. Concatenation Attack (Figure 3)
- The same generation method is used to carry out a manipulation attack (adversarial tweets replacing original tweets), with budgets of 1 each, and the victim model is Stocknet.
- The authors state that the manipulation attack outperforms the concatenation attack in ASR and F1, but the concatenation attack reaches a similar order of magnitude; the specific values in the figure are unreadable in the text conversion.
- On this basis the authors argue that the two attacks are not transferable between each other and are different tasks under different assumptions, providing additional evidence on the transferability of language attacks.
Trading Simulation (Figure 4, Figure 5)
- Stocknet with a Long-Only Buy-Hold-Sell strategy, initial $10K, about 2 years: the authors state that a quote tweet with a single-word replacement can cause an additional $3.2K (75%−43%) loss; the abstract and conclusion state 23%–32% additional loss (the conclusion writes 32%).
- Figure 5 performs the same simulation on FinGRU and FinLSTM (JO, replacement perturbation); the authors state that replacement perturbation again outperforms deletion perturbation; the endpoint values of the net value curves in the figure are unreadable in the text conversion.
Other Ablations and Analyses
- Attack budget (Figure 2, Stocknet, JO): a larger budget gives higher ASR but the increase is small, and the authors state that performance tends to saturate.
- Number of iterations (Figure 6, JO, at most 10 rounds): the three models converge after about 4 rounds, with ASR rising in the first 4 rounds and then flattening or slightly decreasing; the authors state that the attack is insensitive to the iteration hyperparameter.
- Regularization ablation (Appendix D): removing the sparsity regularization gives consistent results; loss smoothing with added Gaussian noise (averaged over 10 evaluations) brings no benefit.
- Attack word analysis (Figure 7, LIWC features + K-means + PCA): the 18 corpora fall into three clusters—financial, Brown general, and attack words; the authors state that the words selected by the solvers are closer to the financial corpus cluster than random attack words.
- Attack examples: Table 3 in Appendix F gives 10 examples of adversarial quote tweets, illustrating that instances originally predicted positive are flipped to negative after injection.
What are some points that can be further explored?
The authors propose building more robust human-in-the-loop architectures in the future to address black-box attacks and the like; the experiments cover three models and one dataset.
Limitations and Future Directions Noted by the Authors
- The authors state that the goal is to raise the financial industry's awareness of AI model risks, and that future work can develop more robust human-in-the-loop AI architectures to address this and other real-world attacks, including black-box attack, unknown input domains, etc. (Conclusion).
- The paper has no dedicated section discussing limitations.
Scope of Experimental Coverage
- The models evaluated are Stocknet, FinGRU, and FinLSTM, 3 in total, all binary classification models trained by the paper itself (Section 3, Appendix B.2).
- The dataset is the single Xu and Cohen (2018) dataset: 88 stocks, 10,824 instances, 57,533 tweets, 2014–2016 (Appendix B.1).
- The attack is applied only to instances in the test set that were originally correctly classified; the highest ASR is 19.7% (FinLSTM, AGO, replacement perturbation, Table 1).
- The trading simulation uses a single Long-Only Buy-Hold-Sell strategy, initial $10K, about 2 years; Figure 4 reports only Stocknet, and Figure 5 reports FinGRU and FinLSTM (Section 4, Appendix C.1).
- The paper does not report the number of attack queries, running time, or number of repeated experiments, nor does it report human evaluation of generated tweets or quantitative measurement of semantic similarity; the specific values in Figures 2, 3, and 5 are not given in the text.
Summarize the main content of the paper
Concatenation-style adversarial tweet attack on stock prediction models: injecting a semantically similar quote tweet can flip predictions and cause simulated losses.
An adversarial attack paper targeting financial NLP models, studying whether tweet-based stock direction prediction models can be deceived by injected malicious tweets.
- Problem: Social media data is widely used for stock price prediction, but the adversarial robustness of models is underexplored; in reality, attackers cannot modify others' tweets and can only post new tweets.
- Method: Proposes a text-concatenating attack that injects adversarial quote tweets into the model input; models tweet selection, word selection and synonym replacement as a hierarchical combinatorial optimization with budget constraints, and generates perturbations using the JO solver with convex relaxation plus PGD and the AGO solver with alternating greedy search.
- Main results: On Stocknet, FinGRU and FinLSTM, with each budget at 1, the ASR of replacement perturbations is 11.8%–19.7%, higher than 4.5%–11.9% for random attacks (Table 1); deletion perturbations are overall weaker (Table 2).
- Monetary impact: The authors state that in the Long-Only Buy-Hold-Sell simulation on Stocknet, a single-word replacement quote tweet caused about $3.2K in additional losses over about 2 years, and the abstract and conclusion state additional losses of 23%–32%.
- Other findings: The authors state that manipulation attacks outperform concatenating attacks but the two do not transfer; gains tend to saturate as the budget increases, and a single-tweet word budget is the most cost-effective; the solvers converge in about 4 rounds.
- Authors' conclusion: The attack can still consistently deceive multiple financial forecasting models under the real-world constraint of not being able to modify the original text; the authors call on the financial community to take such risks seriously and to build more robust human-in-the-loop architectures in the future.