1. Introduction
Sarcasm presents a unique challenge in natural language processing (NLP) due to its intrinsic deviation from literal meaning. It operates through irony, exaggeration, or contradiction, often reversing surface-level sentiment to convey an opposite intention. This subtle form of expression is pervasive in online discourse, particularly on platforms such as Twitter, Reddit, and discussion forums. Detecting sarcasm remains difficult for automated systems, primarily because textual data lack the vocal intonation and facial cues that typically signal sarcastic intent in human communication. Effective sarcasm detection is essential for sentiment analysis, opinion mining, and social media monitoring. Misinterpreting sarcasm can invert sentiment polarity and distort the results of downstream applications, including brand reputation tracking, political discourse analysis, and customer feedback interpretation. For instance, a sarcastic comment praising a malfunctioning service may be incorrectly classified as positive sentiment, misleading analytics and decision-making processes.
Early approaches to sarcasm detection relied on rule-based and traditional machine learning models built on handcrafted features. These included syntactic patterns, sentiment polarity contrast, and stylistic cues such as capitalization, punctuation frequency, and word elongation. Riloff et al. [
1] demonstrated that sarcasm often arises from the juxtaposition of overtly positive sentiment and a negative situational context. Although these approaches offered interpretability, they lacked robustness when applied to noisy or domain-shifted data due to their limited contextual understanding.
The emergence of deep learning has substantially improved the ability to model linguistic context and nuance. Architectures such as recurrent neural networks (RNNs), convolutional neural networks (CNNs), and attention-based models have enabled the sequential modeling of sentiment and context, achieving significant gains over static feature-based methods. More recently, contextual deep learning models and transformer architectures have significantly improved sarcasm detection by leveraging richer contextual dependencies, as demonstrated in recent works such as Helal et al. (2024) [
2] and transformer-based architectures like BERT and RoBERTa [
3]. These models perform strongly on benchmarks such as iSarcasmEval and SARC 2.0 by capturing fine-grained semantic dependencies.
However, transformer-based systems still face notable limitations. Although they are exposed to stylistic cues such as exaggerated punctuation, elongated words (e.g., “Sooo helpful”), or capitalization, these sparse signals may not always remain explicitly preserved in the final sentence representation, especially in noisy user-generated text [
4]. These stylistic markers, although subtle, are often more salient than semantics in informal, user-generated content. Additionally, fine-tuning large-scale transformers demands extensive computational resources, which restricts their use in real-time or low-resource environments.
Recent research has sought to integrate user-centric or contextual metadata to enhance sarcasm detection. The CASCADE model, for example, incorporates historical user behavior and conversational context, while other works such as Interpretable Self-Attention and fine-tuned GPT-3 [
5] models have demonstrated strong performance. Nonetheless, these methods introduce architectural complexity and often depend on external contextual metadata or proprietary resources, which reduces scalability and reproducibility in general NLP pipelines.
A key limitation across many existing systems lies in the absence of a unified and efficient model capable of jointly modeling deep semantic representations and surface-level linguistic features. Transformer-based embeddings capture contextual depth effectively, yet sparse stylistic and pragmatic cues may not always remain explicitly accessible in the final fused representation, especially when sarcasm depends on localized markers such as punctuation emphasis, capitalization, or elongation. Conversely, handcrafted linguistic features provide explicit indicators such as punctuation exaggeration or sentiment contrast but typically fail to generalize across diverse domains. When these two feature spaces are combined, the resulting high dimensionality frequently introduces noise and overfitting, issues that most existing systems do not adequately address through feature selection or regularization mechanisms. Beyond these architectural concerns, sarcasm-detection models continue to face several fundamental research challenges:
The ambiguity of sentiment inversion, where literal polarity diverges from intended meaning;
Domain and context dependency, as sarcastic cues vary significantly across platforms, cultures, and topics;
Data imbalance and annotation subjectivity, since sarcastic expressions are relatively infrequent and often inconsistently labeled;
Limited generalization to implicit or multi-sentence sarcasm, which requires pragmatic and discourse-level reasoning; and
Lack of interpretability, as deep models rarely reveal which linguistic or contextual factors drive sarcastic inference.
Collectively, these limitations underscore the need for hybrid architectures that combine semantic understanding with explicit linguistic and pragmatic cues while maintaining interpretability and robustness across domains.
To address these challenges, we propose
HYSARD, a hybrid feature-fusion model for sarcasm detection that combines contextual sentence embeddings with explicit linguistic descriptors. Specifically, the model integrates RoBERTa-based sentence embeddings with sentiment polarity scores derived from VADER [
6], stylistic markers such as punctuation usage, elongated words, and capitalization, syntactic information derived from part-of-speech tags, and TF-IDF lexical features. To reduce redundancy in the fused representation, we apply a Random Forest-based feature selection strategy that preserves the most informative dimensions [
4]. Furthermore, to mitigate the bias introduced by class imbalance, we employ the Synthetic Minority Over-Sampling Technique (SMOTE) during training [
7].
The main contribution of this work lies in the design and empirical validation of a hybrid sarcasm-detection pipeline rather than in the introduction of a fundamentally new deep neural architecture. Specifically, HYSARD combines frozen contextual sentence embeddings with explicit sentiment, stylistic, syntactic, and lexical descriptors within a unified text-only hybrid architecture. In addition, the proposed pipeline incorporates Random Forest-based feature selection to control redundancy in the fused space and to provide insight into the relative contribution of feature groups. The model is evaluated on three widely used sarcasm detection benchmarks, namely iSarcasmEval [
8], SARC 2.0 Main Balanced, and SARC 2.0 Political Balanced, and is further analyzed through an ablation study to quantify the contribution of each feature family.
Experimental results show that HYSARD achieves strong performance across the evaluated datasets, including an F1-score of 0.80 on iSarcasmEval. These findings suggest that combining contextual embeddings with carefully selected linguistic features remains an effective strategy for sarcasm detection, particularly in noisy and stylistically rich social media text.
The remainder of this paper is organized as follows.
Section 2 reviews related work on sarcasm detection.
Section 3 presents the materials and methods, including the proposed HYSARD model, the datasets, and the experimental protocol.
Section 4 reports the experimental results and discusses the main findings.
Section 5 concludes the paper and outlines future research directions.
2. Related Work
Sarcasm detection has evolved significantly over the past decade, transitioning from rule-based and feature-engineered approaches to deep neural networks and transformer-based language models. Despite this progress, capturing the duality of sarcastic intent, often expressed through subtle linguistic cues and complex contextual dependencies, remains a core challenge. This section reviews the major methodological directions in sarcasm detection, critically assessing their contributions and limitations in the context of our proposed hybrid system.
2.1. Feature-Based and Traditional Machine Learning Approaches
Early work on sarcasm detection predominantly relied on manually crafted linguistic features. These systems aimed to detect textual incongruities such as sentiment polarity shifts, where positively framed language contrasts with a negative scenario, as shown by Riloff et al. [
1]. Their work notably modeled this contrast, highlighting how overtly positive statements can carry implicit negative intent, an observation that remains foundational to sarcasm modeling [
9].
Commonly used features included sentiment scores, part-of-speech (POS) distributions, syntactic irregularities, and stylistic markers such as repeated punctuation, all-caps words, and emoticons. Classical machine learning models such as Support Vector Machines, Logistic Regression, Decision Trees, and Random Forests were applied to these features with considerable success on curated datasets. Their simplicity and interpretability made them appealing for early experimentation [
10].
However, these approaches lacked semantic depth. Their performance dropped sharply when faced with domain shifts, informal language, or implicit sarcasm. For example, a sarcastic tweet that relies on cultural references or understated phrasing may evade models trained on overt lexical patterns. Moreover, handcrafted features are inherently brittle; their relevance can degrade quickly in real-world, user-generated content streams.
2.2. Deep Learning with Distributed Representations
The shift from sparse lexical representations to distributed embeddings marked an important transition in sarcasm detection. Static word-embedding methods such as Word2Vec [
11] and GloVe [
12] enabled richer semantic comparisons than bag-of-words representations by encoding distributional similarity in continuous vector spaces. These embeddings were subsequently integrated into neural architectures such as Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), and their gated variants, including LSTM and GRU, to model local and sequential dependencies in sarcastic text.
Distributed representations improved sarcasm detection by allowing models to learn patterns beyond fixed lexical cues, including sentiment shifts, rhetorical contrasts, and context-sensitive usage. However, static embeddings remained limited because each word was assigned a single representation regardless of context, making them less suitable for figurative and polarity-reversing language. Sequence models partially alleviated this issue by modeling word order and local context, but they still struggled with long-range dependencies and with the subtle pragmatic nature of sarcasm in short, noisy social-media text.
These limitations motivated the transition toward contextualized encoders and transformer-based models. At the same time, earlier work on deep contextualized sarcasm modeling, such as the ACE model of Babanejad et al. [
13], already showed that embedding-based sarcasm detection can benefit from the integration of contextual and affective cues rather than relying on semantic representations alone.
2.3. Transformer-Based Language Models
Transformer architectures, especially BERT and RoBERTa [
3] and GPT variants [
5], have substantially raised the performance ceiling in sarcasm detection. These models are pre-trained on massive corpora and can capture context-sensitive representations of language via self-attention mechanisms. Their ability to encode long-distance dependencies and disambiguate figurative language has proven especially useful in detecting sarcasm, which often relies on subtle shifts in tone and implication.
For instance, Potamias et al. [
14] demonstrated that using RoBERTa [
3] embeddings in combination with a recurrent-convolutional architecture enhances the model’s sensitivity to sarcasm and irony. Fine-tuning transformer models on sarcasm datasets such as iSarcasmEval and SARC 2.0 has produced strong baseline results.
Nevertheless, these models are not without drawbacks. While effective at encoding semantic context, they frequently provide limited transparency regarding which cues drive sarcastic predictions, and they may underutilize sparse surface-level signals such as punctuation bursts, uppercase emphasis, or elongated forms when these cues are not explicitly modeled. Additionally, the high computational cost of training and inference limits their applicability in latency-sensitive or resource-constrained environments. Recent studies have continued to strengthen transformer-based sarcasm detection through contextual modeling. For example, Helal et al. [
2] showed that incorporating contextual information into transformer architectures such as RoBERTa and DistilBERT can substantially improve sarcasm recognition, while Dubey et al. [
15] highlighted the growing importance of context-aware and transformer-centered pipelines in recent sarcasm-detection research.
2.4. Context-Aware and User-Centric Models
Sarcasm is often context-dependent, not only linguistically but also socially and behaviorally. Recognizing this, researchers have increasingly turned toward context-aware and user-centric models, most notably the work of Hazarika et al. [
16]. Their CASCADE model captures speaker-specific behavior and conversational interaction history to improve sarcasm detection. The study demonstrated that incorporating author-level and discourse-level information leads to notable improvements in performance.
Other studies have employed conversation threads, reply hierarchies, and user engagement metrics to enrich text representations. These models are particularly effective when sarcasm is expressed through subtle contradiction or irony that becomes evident only within conversational context.
However, the dependency on external metadata poses practical limitations. In many real-world scenarios, access to user history, prior posts, or thread structures may be restricted due to privacy concerns, API limitations, or platform differences. These dependencies also reduced portability across domains and make large-scale deployment more complex.
2.5. Hybrid Approaches and Feature Fusion
To address the limitations of purely shallow feature-engineered methods and purely end-to-end deep architectures, recent sarcasm-detection research has increasingly explored hybrid models that combine contextual encoders with auxiliary linguistic, affective, or structural features. The central motivation behind these approaches is that sarcastic meaning rarely depends on semantics alone; rather, it often emerges from the interaction between contextual meaning, sentiment incongruity, lexical emphasis, discourse structure, and other explicit cues.
A representative early contribution in this direction is the ACE model proposed by Babanejad et al. [
13], which extends BERT-based sarcasm detection by integrating affective and contextual information. Their results showed that this hybrid design can achieve strong performance across multiple benchmarks, with reported F1-scores of 92.21 on Onion, 89.22 on Reddit, 80.71 on Ptáček, 84.57 on SemEval-2018, and 93.14 on IAC. These findings suggest that contextual embeddings can benefit substantially from complementary affective signals rather than operating as standalone semantic encoders.
More recent studies have reinforced the effectiveness of hybrid sarcasm-detection pipelines. Khan et al. [
17] introduced a hybrid transformer-based architecture that combines RoBERTa, Bi-LSTM, and multi-head attention for sarcasm detection in news headlines. Their model illustrates the value of coupling contextual embeddings with sequential modeling and attention-based refinement in order to better capture sarcastic incongruity. Along a different line, Awan et al. [
18] proposed a hybrid CapsNet–LSTM architecture with feature optimization for social-media sarcasm detection and reported 86.0% accuracy with an F1-score of 81.6% on Reddit, together with 78.5% accuracy on Twitter. Safeer et al. [
19] introduced SarcAE, a hybrid model that combines embedding fusion, autoencoder-based abstraction, and fuzzy-logic reasoning, and reported 98.53% accuracy on a news-headline dataset and 89.83% accuracy on an ironic-tweet dataset.
Taken together, these studies confirm that hybrid sarcasm-detection systems can achieve strong empirical performance by combining contextual representations with complementary linguistic, affective, or reasoning-oriented components. At the same time, their results should be interpreted cautiously because they were obtained on different datasets, class distributions, preprocessing pipelines, and evaluation protocols. Consequently, these reported scores are more useful for demonstrating the general effectiveness of hybrid modeling than for establishing direct head-to-head superiority across studies.
Our work belongs to this hybrid line of research, but it differs in three practical respects. First, it operates solely on text, without requiring user history, conversational metadata, or multimodal signals. Second, it combines frozen RoBERTa sentence embeddings with explicit sentiment, stylistic, syntactic, and TF-IDF features. Third, it introduces a Random Forest–based feature selection stage to reduce redundancy in the fused representation and retain only the most informative dimensions. This design yields a compact and portable model for sarcasm detection across multiple benchmark datasets.
3. Materials and Methods
In this section, we describe HYSARD, a hybrid feature-fusion model for sarcasm detection that integrates contextual sentence embeddings with explicit linguistic features. The architecture is designed to capture both deep semantic information and surface-level stylistic cues that frequently signal sarcasm in user-generated text.
Figure 1 presents an overview of the full pipeline. The model consists of five main stages: text preprocessing, feature extraction, feature fusion, feature selection, and final classification.
3.1. Data Preprocessing
Each input instance consists of a raw textual utterance drawn from one of the benchmark sarcasm detection datasets described in
Section 3.7. The preprocessing pipeline is intentionally lightweight in order to preserve stylistic and pragmatic cues that may be informative for sarcasm detection.
First, the text is normalized through lowercasing. Second, tokenization is applied to prepare the input for feature extraction. Third, noisy artifacts that do not contribute to sarcasm modeling, such as malformed URLs or irrelevant markup when present, are removed. Importantly, expressive textual markers such as repeated punctuation, elongated words, and capitalization are preserved because they are later used as stylistic features. This preprocessing strategy ensures consistency across datasets while maintaining the linguistic signals that are often suppressed by more aggressive cleaning procedures.
3.2. Feature Extraction
To capture the multifaceted nature of sarcasm, we extract several feature types from the preprocessed text:
3.2.1. Sentiment Features
Sarcastic utterances often invert the apparent sentiment. We use the VADER [
6] (Valence Aware Dictionary and sEntiment Reasoner) tool to compute four sentiment scores (negative, neutral, positive, and compound) for each sentence. These scores quantitatively reflect the sentiment polarity, providing a signal for potential sentiment inversion in sarcastic expressions.
3.2.2. Stylistic Features
Certain stylistic attributes are indicative of sarcasm. We extract:
Punctuation Usage: Counts of exclamation marks, question marks, and periods capture the emphasis or hyperbole often used in sarcastic language.
Capitalization Patterns: The number of all-uppercase words can denote exaggeration.
Elongated Words: The frequency of words with repeated characters (e.g., “Soooo”) highlights emotive or emphatic emphasis.
3.2.3. Syntactic Features
To encode grammatical structure, we extract part-of-speech (POS) tag distributions using spaCy’s POS tagging pipeline [
20]. Chiche and Yitagesu (2022) [
21] demonstrated that POS information provides a reliable structural representation of text by assigning grammatical roles such as nouns, verbs, adjectives, and adverbs to each token. Variations in POS tag frequencies can reveal structural patterns that differentiate sarcastic from non-sarcastic text, enabling the model to capture how meaning is shaped through syntactic organization rather than relying solely on lexical cues. Such structural regularities are particularly useful in distinguishing straightforward statements from rhetorically complex or contextually shifting expressions.
The effectiveness of POS-based syntactic information in improving contextual interpretation, stability, and downstream task performance has been widely recognized in the NLP literature. Motivated by these findings, POS-derived syntactic descriptors in our model serve as complementary structural features that enrich the feature space and contribute to more reliable sarcasm discrimination.
3.2.4. Lexical Features via TF-IDF
To capture lexical salience across the corpus, we employed the Term Frequency–Inverse Document Frequency (TF-IDF) representation [
22], a widely used weighting scheme in text mining. Each sentence or tweet is transformed into a TF-IDF vector by assigning higher weights to terms that occur frequently in a given document but are less common across the entire dataset. This allows the model to focus on distinctive lexical cues that are often associated with sarcastic intent. For computational efficiency, the feature space was restricted to the top 5000 n-grams.
Formally, the TF-IDF weight for a term
t in document
D is given as:
where
denotes the term frequency of
t in document
D and
the inverse document frequency. Specifically,
Here, is the number of times word t occurs in the document, T is the total number of words in the document, n is the total number of documents in the corpus, and is the number of documents in which t appears.
This representation enables the model to discriminate between high-utility tokens (e.g., sarcastic markers or contextually charged words) and ubiquitous terms that carry limited information. By encoding these weighted lexical features, TF-IDF provides a robust foundation for subsequent classification layers to detect subtle cues underlying sarcastic utterances.
3.2.5. Deep Contextual Features
To capture sentence-level semantics, we use the SentenceTransformer implementation of the pre-trained
all-roberta-large-v1 model [
3,
23]. This model maps each input sentence to a 1024-dimensional dense embedding vector, providing a compact contextual representation of semantic and pragmatic content. In our model, these embeddings are used as frozen sentence representations rather than being fine-tuned end-to-end, which keeps the overall pipeline computationally efficient while preserving strong contextual encoding capacity.
3.3. Feature Fusion and Random Forest–Based Feature Selection
After extraction, all feature groups were aligned and concatenated into a unified high-dimensional representation for each input text. The fused vector combined the 1024-dimensional RoBERTa sentence embedding with sentiment, stylistic, syntactic, and TF-IDF features. Before concatenation, dense numerical feature blocks, namely the RoBERTa embeddings, sentiment features, stylistic features, and POS-based syntactic features, were normalized using MinMax scaling fitted on the training data only. In contrast, TF-IDF retained its standard weighted representation. This design ensured that dense semantic embeddings and sparse lexical descriptors were merged on comparable numerical scales while avoiding information leakage from the validation or test data.
Although the fused space is highly informative, direct use of all concatenated dimensions may introduce redundancy, irrelevant features, and overfitting. To address this issue, we apply a Random Forest–based feature selection strategy [
24]. In the implementation, feature selection is performed using
SelectFromModel with a Random Forest estimator and an importance threshold of
median. Only features whose importance exceeds this threshold are retained for final classification. This step reduces noise, limits dimensional inflation, and helps identify the most discriminative feature dimensions.
In our final implementation, this procedure reduced the fused feature space from 6051 to 3026 dimensions.
3.4. Handling Class Imbalance
The iSarcasmEval dataset presents a considerable class imbalance, comprising 2601 non-sarcastic instances and 867 sarcastic ones, corresponding to a 75%/25% distribution in the training split. Because such skewed distributions can bias the classifier toward the majority class, we compared several imbalance-handling strategies before selecting the final configuration. In particular, we evaluated four settings: (i) no imbalance correction, (ii) class weighting, (iii) random undersampling, and (iv) SMOTE.
In the final configuration, we retained the Synthetic Minority Over-sampling Technique (SMOTE) [
7].
Table 1 reports the class distribution before and after applying SMOTE. As shown, the algorithm transformed the original 2601/867 distribution into a balanced 2601/2601 training set.
The SMOTE procedure can be summarized in three steps:
For each minority instance , identify its k nearest minority-class neighbors in feature space.
Randomly select one neighbor from this set.
Generate a synthetic sample by interpolation:
Importantly, in our pipeline SMOTE was applied in the learned feature space rather than at the raw-text level. Consequently, it generated interpolated feature representations instead of artificial textual sequences. As shown later in the imbalance-handling ablation, this choice provided the most favorable trade-off between global performance and minority-class sensitivity among the tested strategies.
3.5. Final Classification and Model Training
The final classifier used in HYSARD is a Random Forest model. We selected this classifier because it performed strongly in preliminary experiments while also providing feature importance estimates that help characterize the relative contribution of feature groups. Hyperparameter optimization was performed using
GridSearchCV [
25] on the training portion of each dataset only.
For datasets with official train/test splits, model selection was conducted exclusively on the training split using stratified 5-fold cross-validation. Within each fold, feature extraction components that require fitting, feature selection, and SMOTE were applied only on the training fold and then transferred to the corresponding validation fold. After hyperparameter selection, the final model was retrained on the full training split and evaluated once on the held-out test set. This protocol was adopted to avoid information leakage and to ensure a fair evaluation of generalization performance.
3.6. Model Evaluation
We evaluate HYSARD on three benchmark datasets: iSarcasmEval from SemEval 2022 [
9], SARC 2.0 Main Balanced, and SARC 2.0 Political Balanced [
26]. The evaluation metrics used in this work are accuracy, precision, recall, and F1-score. For iSarcasmEval, we additionally report the sarcastic-class F1-score because performance on the minority sarcastic class is particularly important in imbalanced settings.
These metrics are defined as follows:
These measures jointly assess overall correctness, class-specific reliability, and the balance between precision and recall.
3.7. Datasets and Statistics
3.7.1. iSarcasmEval (SemEval-2022 Task 6)
Source: Tweets.
Annotation: Self-reported sarcasm labels and non-sarcastic rephrases provided by the original authors. For English tweets, additional fine-grained ironic categories (e.g., satire, understatement, overstatement, rhetorical question) were annotated by trained linguists.
Statistics: The dataset comprises several thousand English tweets, exhibiting a moderate class imbalance (approximately 25% sarcastic). Sarcastic tweets tend to be slightly longer on average, reflecting more elaborate expression and contextual framing.
The following table (
Table 2) summarizes the dataset composition, showing the distribution of sarcastic and non-sarcastic samples in both the training and test splits, as well as the corresponding average word counts.
3.7.2. SARC 2.0 Main Balanced
Source: Reddit comments collected from multiple subreddits, primarily including r/politics.
Annotation: Sarcasm was self-reported by users using explicit markers such as “/s”, which were later removed during preprocessing to prevent data leakage.
Statistics: The dataset is balanced across classes, containing an equal number of sarcastic and non-sarcastic comments. Each comment averages approximately 55 words.
The following table (
Table 3) presents the detailed class distribution for the training and test splits.
3.7.3. SARC 2.0 Political (Balanced)
Source: A subset of the SARC 2.0 corpus restricted to political discussions drawn from Reddit.
Annotation: Sarcasm was self-reported by users using explicit markers such as “/s”, which were subsequently removed during preprocessing.
Statistics: The dataset maintains a perfectly balanced distribution between sarcastic and non-sarcastic comments. Political discussions in this subset tend to be slightly longer on average than those in the general SARC 2.0 corpus, reflecting the more elaborate and argumentative nature of political discourse.
The following table (
Table 4) summarizes the class distribution and average word counts across the training and test sets.
3.8. Experimental Setup
The experimental pipeline used in this work consists of the following stages:
Training–test protocol: For each dataset, we used the official training and test partitions when available. Hyperparameter tuning and model selection were performed only on the training split using stratified 5-fold cross-validation. The held-out test split was used only once for final evaluation.
Preprocessing: Raw text was lowercased and tokenized while preserving stylistic cues such as punctuation, capitalization, and elongated words.
Feature extraction: For each input text, we extracted the following feature groups:
Sentiment features: VADER negative, neutral, positive, and compound scores [
6];
Stylistic features: punctuation counts, all-uppercase words, and elongated-word frequency;
Syntactic features: part-of-speech tag distributions obtained with spaCy [
20,
21];
Lexical features: TF-IDF features with a maximum vocabulary of 5000 n-grams;
Contextual features: sentence embeddings extracted with SentenceTransformer using all-roberta-large-v1 [
23,
27].
Feature fusion and selection: All feature groups were concatenated into a unified representation. A Random Forest-based feature selection stage was then applied to retain the most informative dimensions and reduce redundancy.
Class imbalance handling: SMOTE was applied only on the training fold within each cross-validation split and only on the final training split before test-time evaluation. No oversampling was applied to validation or test data.
Classification: A Random Forest classifier was trained on the selected feature space. Hyperparameters were optimized using GridSearchCV.
Evaluation: Final results were reported using accuracy and F1-score across datasets. For iSarcasmEval, only the F1-score is reported, with particular emphasis on the sarcastic-class F1, as it provides a more informative evaluation under class imbalance.
3.9. Implementation Details
The implementation was based on Python 3.10 and relied on the scikit-learn 1.5.0, spaCy 3.7, sentence-transformers 2.7, PyTorch 2.2, and imbalanced-learn 0.12 libraries. Sentence embeddings were generated using the SentenceTransformer implementation of all-roberta-large-v1, and TF-IDF lexical features were restricted to the top 5000 n-grams. The fused representation was refined using SelectFromModel with a Random Forest estimator and a median importance threshold. Final prediction was performed with a Random Forest classifier whose hyperparameters were optimized through GridSearchCV. All randomized procedures were executed with a fixed random seed. Experiments were carried out in Google Colab on an NVIDIA Tesla V100 GPU (NVIDIA Corporation, Santa Clara, CA, USA).
The final fused representation consisted of 6051 dimensions: 1024 RoBERTa embedding dimensions, 4 sentiment features, 5 stylistic features, 18 POS-based syntactic features, and 5000 TF-IDF lexical features. After feature selection, 3026 dimensions were retained.
Table 5 summarizes the dimensionality of each feature group before and after feature selection.
In-House Fine-Tuned RoBERTa Baseline
For controlled comparison with HYSARD, we implemented an in-house fine-tuned RoBERTa baseline for binary sarcasm classification on iSarcasmEval. In contrast to HYSARD, which uses frozen sentence embeddings, this baseline was trained end-to-end for sequence classification using the pretrained roberta-large checkpoint with a task-specific classification head.
The model was trained on the official iSarcasmEval training split. Hyperparameter selection for the RoBERTa baseline was performed using the same stratified 5-fold cross-validation protocol adopted for HYSARD, and the final configuration was selected according to the mean validation sarcastic-class F1-score. Because the dataset is imbalanced, weighted cross-entropy was used during training. The final hyperparameter configuration is reported in
Table 6.
4. Results and Discussion
In this section, we present the experimental results of HYSARD, including the ablation study, the comparative evaluation against representative baseline models, and a discussion of the main findings. For datasets with official train/test splits, all model selection and hyperparameter tuning procedures were conducted exclusively on the training split using stratified 5-fold cross-validation, whereas final performance was reported separately on the corresponding held-out test split. Unless otherwise stated, cross-validation results reported in this section correspond to model development on the training data and should not be directly compared with final held-out test results obtained under a different evaluation protocol. The main evaluation metrics are accuracy and F1-score, with additional emphasis on sarcastic-class F1-score for iSarcasmEval.
4.1. Ablation Study
To assess the contribution of individual feature groups within our hybrid model, we conducted an ablation study on the iSarcasmEval (SemEval 2022 Task 6) dataset. Each configuration was evaluated using stratified 5-fold cross-validation on the training split only.
Table 7 reports the mean cross-validation accuracy and F1-score for five representative feature combinations.
Feature Groups:
R: Deep contextual embeddings from the pretrained RoBERTa-large model [
3].
S: Sentiment features generated using VADER [
6].
Sty: Stylistic features (punctuation counts, capitalization patterns, elongated words).
POS: Syntactic features derived from spaCy’s POS tagging.
TF-IDF: Lexical features obtained via TF-IDF vectorization (up to 5000 n-grams).
Configurations:
Figure 2 illustrates the performance trend across the five configurations and highlights the progressive improvement obtained as additional feature groups are incorporated. As shown in
Table 7, the strongest performance is achieved by the full configuration (C5), which combines contextual, sentiment, stylistic, syntactic, and lexical information. This result indicates that sarcasm detection benefits from integrating complementary feature families rather than relying on contextual embeddings alone.
Cross-Validation Performance: To assess the robustness of the proposed model, we additionally report the mean and standard deviation of the full HYSARD configuration (C5) across the same 5-fold cross-validation procedure used during model selection. As shown in
Table 8, C5 achieves an average F1-score of 0.80 with a standard deviation of 0.018 and an average accuracy of 0.85 with a standard deviation of 0.015. These results indicate low variance across folds, suggesting stable performance across different training partitions. The corresponding 95% confidence interval for the F1-score is [0.784, 0.816], further supporting the robustness of the model.
Qualitative Insights:
Stylistic Features (Sty): Their inclusion in configuration C2 improves performance by capturing hyperbolic and emphatic expressions.
Syntactic Features (POS): Although POS features alone (C3) provide only modest gains, combining them with stylistic features (C4) yields a clear improvement.
Lexical TF-IDF Features: The integration of TF-IDF in the full model (C5) leads to the highest performance, underscoring the value of domain-specific lexical cues in sarcasm detection.
Note. The results reported in
Table 7 and
Table 8 correspond to cross-validation performance on the training split during model development. They should not be directly compared with the held-out test-set results reported later in the error analysis section, as they are obtained under different evaluation protocols.
4.2. Imbalance-Handling Ablation
Because sarcasm detection datasets are typically imbalanced, we performed an ablation study to evaluate the impact of different class-imbalance handling strategies on iSarcasmEval. Specifically, we compared four settings: (i) no imbalance correction, (ii) class weighting, (iii) random undersampling, and (iv) SMOTE. The results are presented in
Table 9.
The baseline model without rebalancing achieved an F1-score of 0.69, indicating weaker performance under the original class imbalance. Introducing class weighting improved the results substantially, raising the F1-score to 0.76. Among the evaluated rebalancing strategies, SMOTE produced the best ablation result, achieving the highest F1-score of 0.80 together with the strongest balance between precision and recall. In comparison, random undersampling reached an F1-score of 0.72 and remained below both class weighting and SMOTE.
These findings indicate that, within the ablation setting, SMOTE provided the most effective imbalance-handling strategy. This also addresses the common limitation of SMOTE in text classification, since synthetic samples are generated in the learned feature space rather than as artificial text, avoiding unrealistic textual artifacts.
Note. It is important to note that these results correspond to cross-validation performance on the training split during model selection. The final generalization performance on the held-out test set is reported separately in the error analysis section and should not be directly compared to these ablation values, as the two sets of results are obtained under different evaluation protocols.
4.3. Feature Importance Analysis
To provide insight into the model’s behavior, we analyzed feature importance using the Random Forest classifier. It is important to note that these importance scores reflect the relative contribution of feature groups within the model rather than a complete explanation of model behavior.
The results indicate that contextual embeddings and TF-IDF lexical features contribute the largest share of importance, confirming that both semantic understanding and lexical cues are critical for sarcasm detection. As shown in
Figure 3, contextual embeddings account for the highest contribution, followed by TF-IDF features, while stylistic, syntactic, and sentiment features provide complementary but smaller contributions.
Although their individual importance scores are lower, these auxiliary features remain valuable because they capture explicit surface-level signals such as punctuation usage, capitalization, and sentiment contrast, which are often not fully preserved in dense contextual representations. These findings validate the design of HYSARD, demonstrating that hybrid feature fusion effectively combines complementary information sources rather than relying solely on deep contextual embeddings.
4.4. Performance Comparison
To assess the empirical effectiveness of HYSARD, we compare it with representative models reported in the sarcasm detection literature, including traditional machine learning baselines, contextual encoders, and large language model-based approaches. Because these reference results were originally reported under different preprocessing choices, optimization settings, and evaluation protocols, they should be interpreted as literature reference points rather than strictly controlled head-to-head reproductions. Under this caveat, the comparison remains useful for situating the proposed model with respect to existing methods.
For
iSarcasmEval, we report both literature reference models and one controlled in-house transformer baseline. The literature reference results include representative classical, neural, and large language model approaches, namely
STCE [
8],
X-PuDu [
28],
TUG-CIC [
28],
L2-Logistic Regression [
29], the official
SVM baseline [
28], and the fine-tuned
Llama 2 13B model [
30]. In addition, we include a
fine-tuned RoBERTa baseline reproduced under the same train/test split and evaluation protocol as HYSARD.
Table 10 summarizes these results. HYSARD achieves strong performance on this dataset, reaching an F1-score of 0.80.
The in-house fine-tuned RoBERTa baseline obtained an F1-score of 0.45. Although lower than some literature-reported results, it provides a controlled internal neural reference for comparison with HYSARD.
For the
SARC 2.0 Main Balanced dataset, we compare HYSARD with high-performing contextual and attention-based models, including
CASCADE [
16],
Interpretable Multi-Head Self-Attention [
31],
ELMo-BiLSTM Full [
32], and
RCNN-RoBERTa [
14]. As shown in
Table 11, HYSARD achieves competitive performance, with 0.846 accuracy and 0.830 F1-score on this benchmark.
Table 12 reports the results on the
SARC 2.0 Political (Balanced) subset. HYSARD again performs strongly, achieving 0.85 accuracy and 0.83 F1-score. These results suggest that the proposed hybrid representation remains effective even in politically polarized discourse, where sarcasm is often expressed through domain-specific rhetoric and implicit contrast.
4.5. Error Analysis
To better understand the limitations of HYSARD, we conducted an error analysis on the held-out iSarcasmEval test set.
Figure 4 presents the confusion matrix, and
Table 13 reports class-wise precision, recall, and F1-score.
The error analysis shows that HYSARD achieves strong and relatively balanced performance across the two classes, while still performing better on non-sarcastic posts than on sarcastic ones. As reported in
Table 13, the model attains a precision, recall, and F1-score of 0.9667 for the non-sarcastic class, compared with 0.8000 precision, recall, and F1-score for the sarcastic class. These results indicate that the model identifies non-sarcastic instances with very high reliability while also maintaining solid performance on sarcastic posts, which remain the more challenging category.
The confusion matrix in
Figure 4 further shows that 1160 out of 1200 non-sarcastic instances were correctly classified, with only 40 misclassified as sarcastic, whereas 160 out of 200 sarcastic instances were correctly identified and 40 were misclassified as non-sarcastic. This pattern suggests that the proposed hybrid representation is effective for capturing both literal and sarcastic cues, although a performance gap persists in favor of the majority non-sarcastic class.
A qualitative inspection of representative errors shows that false positives often correspond to emotionally charged complaints, colloquial frustration, or humorous remarks that contain expressive language without a true sarcastic reversal. In contrast, false negatives frequently involve implicit sarcasm, praise–blame inversion, understated criticism, or politically charged statements whose sarcastic intent depends on pragmatic inference or contextual knowledge rather than overt lexical markers. These observations indicate that, although the proposed hybrid representation improves class-balanced detection, some remaining errors still stem from sarcasm conveyed through subtle contextual incongruity rather than explicit stylistic signals.
Although the broader iSarcasmEval dataset includes fine-grained irony categories, subtype-wise error analysis could not be performed on the held-out evaluation split used in our experiments because the available test file contained only the text and binary sarcasm labels.
4.6. Discussion
The results presented in
Table 7,
Table 8,
Table 9,
Table 10,
Table 11 and
Table 12 indicate that HYSARD benefits from combining contextual sentence embeddings with explicit linguistic descriptors. Across the evaluated benchmarks, the model shows strong performance, suggesting that sarcasm detection remains well suited to hybrid representations that integrate semantic, lexical, stylistic, and syntactic information.
The ablation study in
Table 7 provides a clearer view of how each feature group contributes to performance. RoBERTa embeddings and sentiment features establish a strong semantic foundation, while the gains observed after adding stylistic, syntactic, and lexical descriptors suggest that these signals provide complementary information under our experimental setting. Although transformer encoders are exposed to punctuation, capitalization, and elongated forms at the token level, the ablation results indicate that explicitly encoded linguistic descriptors can still contribute useful surface-level cues for sarcasm detection. In this sense, handcrafted feature blocks preserve indicators such as punctuation density, uppercase emphasis, elongated-word frequency, sentiment polarity contrast, and domain-specific lexical salience in dedicated dimensions. The improved performance of the full model therefore supports an empirical interpretation of complementarity rather than a definitive claim about a general limitation of transformer models.
The imbalance-handling ablation further supports this design choice. Among the tested strategies, SMOTE provided the most favorable trade-off between overall performance and balanced detection, outperforming no rebalancing, class weighting, and random undersampling on iSarcasmEval. This result suggests that, when applied in the learned feature space rather than at the raw-text level, SMOTE can improve robustness to class imbalance without sacrificing the stability of the overall pipeline.
On the iSarcasmEval dataset (
Table 10), HYSARD achieves an F1-score of 0.80. This result suggests that combining contextual embeddings with explicit linguistic signals is effective for short and informal social media texts, where sarcasm is often expressed through sentiment contrast, rhetorical emphasis, or stylistic exaggeration. The result is particularly relevant because iSarcasmEval is based on self-reported sarcasm, making it a challenging benchmark for models that rely solely on surface semantics.
The comparatively modest performance of the in-house fine-tuned RoBERTa baseline, together with the ablation results, suggests that the proposed hybrid design benefits from explicitly encoded linguistic cues under the evaluated experimental conditions. This observation should be interpreted as empirical evidence of complementarity in our setting rather than as a definitive limitation of transformer-based models in general.
On the SARC 2.0 Main Balanced dataset (
Table 11), HYSARD attains 0.846 accuracy and 0.830 F1-score, while on the SARC 2.0 Political Balanced dataset (
Table 12) it reaches 0.85 accuracy and 0.83 F1-score. These results suggest that the proposed hybrid representation generalizes reasonably well across different forms of user-generated discourse, including longer and more domain-specific Reddit comments. In particular, the results on the political subset indicate that the model remains effective even when sarcasm is expressed through topic-specific rhetoric and implicit contrast.
Another practical strength of HYSARD is that it relies on frozen RoBERTa embeddings instead of full transformer fine-tuning. This design simplifies training and makes the model easier to deploy in settings where computational resources are limited. At the same time, the Random Forest-based feature selection stage highlights the relative importance of feature groups while reducing the fused space to a smaller subset of discriminative features.
Despite these strengths, several limitations remain. First, the current study is restricted to English-language datasets. Second, sarcasm annotations, particularly self-reported or user-marked labels, may still contain subjectivity or platform-specific bias. Third, the model operates purely at the text level and does not incorporate conversational context, user history, emojis, images, or multimodal signals that may further improve sarcasm detection. Fourth, the TF-IDF component may capture dataset-specific lexical cues that are strongly associated with sarcasm in the evaluated corpora but may not transfer equally well across domains or platforms with different lexical distributions. This suggests a degree of domain dependence in the lexical feature space and should be considered when interpreting cross-dataset generalization. Finally, because the comparative baselines reported in
Table 10,
Table 11 and
Table 12 were collected from prior studies, some differences should be interpreted cautiously unless all systems are reproduced under an identical protocol. In addition, although literature-reported LLM results are included for contextual positioning, zero-shot and few-shot LLM evaluations were not reproduced in-house in the current study.
Overall, the findings suggest that HYSARD provides a robust model for sarcasm detection and that hybrid feature fusion remains a strong alternative to purely end-to-end transformer approaches in noisy social media environments.
5. Conclusions
This paper presented HYSARD, a hybrid feature-fusion model for sarcasm detection that combines RoBERTa-based sentence embeddings with sentiment, stylistic, syntactic, and TF-IDF lexical features. The proposed model was designed to capture both contextual meaning and explicit linguistic signals that are often important in sarcastic user-generated text.
Experimental results on iSarcasmEval, SARC 2.0 Main Balanced, and SARC 2.0 Political Balanced show that HYSARD achieves strong and consistent performance across datasets, with particularly encouraging results on iSarcasmEval in terms of F1-score and class-wise discrimination. The ablation study further demonstrates that the integration of multiple feature groups improves sarcasm detection relative to reduced configurations. In addition, the Random Forest-based feature selection stage helps reduce redundancy in the fused representation and provides insight into relative feature contribution, while SMOTE improves learning balance in imbalanced settings.
These results indicate that hybrid feature fusion remains an effective and computationally practical strategy for sarcasm detection, particularly when stylistic and lexical cues play an important role. At the same time, the study has several limitations, including its restriction to English-language datasets, its dependence on text-only input, and the absence of controlled in-house reproductions for all literature baselines.
Future work will focus on multilingual sarcasm detection, multimodal extensions, and the integration of conversational context. Additional research should also examine the efficiency–accuracy tradeoff of hybrid models under identical experimental conditions and on broader cross-domain benchmarks.