Diogo Fernandes Costa Silva

Author directory

Also published as: Diogo Fernandes


2026

The widespread use of LLMs in software development has made the detection of machine-generated code a pressing challenge, particularly when models must generalize across programming languages and domains. We present a lightweight, LLM-free pipeline that combines stylometric feature extraction with a LightGBM classifier and explicitly prioritizes structural generalization over deep semantic modeling. Despite its simplicity, the method achieves a Macro F1 of 0.70–0.72, more than doubling the CodeBERT baseline (0.30) in SemEval-2026 Task 13 Subtask A, while operating without GPUs or any fine-tuning.
This submission investigates efficient multi-turn retrieval under constrained computational settings. We analyze how passage granularity and conversational query rewriting affect retrieval effectiveness across four benchmark domains. Using compact, locally deployable components, we show that smaller passage segmentation improves early-rank performance and that lightweight keyword-oriented query reformulation substantially enhances dense retrieval quality.Importantly, we observe that rewriting interacts differently with encoder backbones: some compact models benefit significantly from increased query specificity, while others degrade, indicating sensitivity to rewrite-induced distribution shifts. Our findings demonstrate that competitive multi-turn retrieval does not require large proprietary models, but can emerge from principled structural and preprocessing design choices. The results highlight the importance of aligning chunking strategy, rewriting policy, and encoder characteristics in resource-efficient MT-RAG systems.
The development of robust hate speech detection systems remains limited by the lack of large-scale, fine-grained training data, especially for languages beyond English. Existing corpora typically rely on simplistic toxic and non-toxic labels, and the few that capture hate directed at specific minority groups lack the positive counterexamples required to distinguish genuine hate from mere discussion. In this work, we introduce ToxSyn-PT, the first Portuguese large-scale corpus explicitly designed for multi-label hate speech detection across nine protected minority groups, including the non-toxic counterexamples absent in all other public datasets. Generated via a controllable four-stage pipeline, ToxSyn contains discourse-type annotations to capture rhetorical strategies of toxic/non-toxic language, such as sarcasm, dehumanization, and cultural appreciation. Our experiments reveal a catastrophic, mutual generalization failure compared to existing datasets from social-media domains: models trained on social media struggle to generalize to minority-specific contexts, and vice-versa. This finding indicates they are distinct tasks and exposes summary metrics like Macro F1 can be unreliable indicators of true model behavior, as they completely mask model failure. We publicly release ToxSyn on HuggingFace to support reproducible research on synthetic data generation and benchmark progress in hate-speech detection for low- and mid-resource languages.
Current safety evaluations of large language models (LLMs) create a dangerous illusion of universal protection by aggregating harms under generic categories such as “Identity Hate”, obscuring vulnerabilities toward specific populations. In this work, we expose the Selective Safety Trap: a systemic failure mode where models robustly defend specific populations while leaving underrepresented communities highly vulnerable to identical adversarial attacks. To systematically audit this phenomenon, we introduce MiJaBench, a bilingual (English–Portuguese) adversarial benchmark comprising 43,961 controlled jailbreaking prompts across 16 minority groups. By evaluating 14 state-of-the-art LLMs on MiJaBench, we curate 615,454 prompt-response pairs that compose MiJaBench-Align, revealing that safety alignment is not a uniform semantic capability but a demographic hierarchy, with defense rates fluctuating by up to 42% within the same model solely based on the target group. This disparity persists across architectures and languages and is amplified by scaling, indicating that current alignment methods learn group-specific safeguards rather than a generalized notion of harm. Through targeted direct preference optimization (DPO) on a 1B-parameter baseline, we achieve strong zero-shot safety generalizations to entirely unseen demographics and complex attack strategies. We release all datasets and scripts to provide the community with a concrete pathway toward equitable, transferable safety alignment.
Instruction-following is a core capability of Large Language Models (LLMs), as they must reliably comply with instructions constraints before being able to be evaluated on downstream tasks. In this scenario, instruction-following benchmarks for low-resource languages remain limited, particularly for Portuguese, where existing evaluations are mostly based on translated English datasets and fail to capture language specific linguistic phenomena. We introduce Portuguese-IFEval, a benchmark for evaluating instruction following in Portuguese built through semantic regionalization. The benchmark contains a total of 1236 instructions across 535 prompts, each prompt have up to three verifiable instructions, combining adapted instructions with Portuguese-specific orthographic, grammatical, and discourse-level constraints. We evaluate 25 proprietary, open-source, and Portuguese-tuned LLMs under a unified protocol, establishing a comprehensive benchmark for Portuguese instruction-following evaluation. Our results show that, while English and Spanish remain the strongest-performing languages, Portuguese still presents substantial challenges, which are effectively exposed by our benchmark. Our code is available at: https://github.com/gap-ufg/Portuguese-IFEval.
Speech Retrieval-Augmented Generation (Speech RAG) systems are increasingly used in real-world settings where spoken queries vary across speakers, emotions, and acoustic conditions. However, current evaluations primarily focus on clean-condition retrieval accuracy, leaving unclear whether these systems remain semantically invariant under paralinguistic variation. We introduce ParaSpeechRAG, a counterfactual robustness benchmark that isolates non-semantic acoustic factors while preserving lexical content. The benchmark spans controlled perturbations across speaker identity, emotion and prosody, additive noise, speaking rate, and codec compression, enabling systematic evaluation of semantic invariance in speech retrieval. We evaluate three retriever families: ASR-based cascades, speech-text multimodal retrievers (CLASP), and general-purpose audio-language models (GLAP). Results reveal a consistent robustness–accuracy trade-off: multimodal retrievers achieve higher performance under clean conditions but are substantially more sensitive to paralinguistic and acoustic perturbations, particularly emotion and noise. In contrast, ASR-based cascades are more robust to these variations due to their text-centric bottleneck, though with reduced expressive capacity. These findings highlight an overlooked dimension of instability in Speech RAG systems and underscore the need for robustness-aware evaluation beyond clean-condition benchmarks.

2022

This paper summarizes our work on the document classification subtask of Multilingual protest news detection of the CASE @ ACL-IJCNLP 2022 workshok. In this context, we investigate the performance of monolingual and multilingual transformer-based models in low data resources, taking Portuguese as an example and evaluating language models on document classification. Our approach became the winning solution in Portuguese document classification achieving 0.8007 F1 Score on Test set. The experimental results demonstrate that multilingual models achieve best results in scenarios with few dataset samples of specific language, because we can train models using datasets from other languages of the same task and domain.