arXiv:2609.09791cs.CLSep 2026

Manuscript Offprint

arXiv:2609.09791

MUCnoHARM@GermEval Shared Task 2026: Retrieval-based In-Context Learning for Defamatory Offences, and Where It Falls Short

Kristin Gnadt, Maximilian Meidinger, Matthias Aßenmacher

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

With hate speech being ubiquitous online, automatic detection is crucial, in particular when it comes to criminally relevant social media posts. We study a variety of retrieval-based in-context learning (RetICL) strategies for detecting defamatory offences under §§ 185–187 StGB (the subject of GermEval 2026 Subtask 4). Few-shot prompting beats zero-shot, but retrieval-based approaches offer only marginal gains over random demonstrations, and even fall behind an optimised static set of demonstrations. Providing concrete legal knowledge helps, yet model choice outweighs every other system choice. Models over-predict criminal relevance while still missing 26–57% of criminally relevant posts, suiting them for triage rather than autonomous moderation.

1 Introduction

Hate speech detection has become a socially consequential application domain for LLM-based text classification. Hate speech is highly prevalent online: In Germany, 34% of internet users reported encountering instances thereof in the first quarter of 2025 (Destatis, 2025). The volume of potentially harmful content has far outstripped the capacity of human moderation, making automated detection a critical concern for platforms and policymakers alike (European Union Agency for Fundamental Rights, 2023). Large language models (LLMs) have demonstrated strong capabilities in addressing the core semantic challenges of automated hate speech detection (Albladi et al., 2025; Kums et al., 2025), making them a natural fit for the task. To date, most research has focused on English-language datasets and settings (Albladi et al., 2025; Gandhi et al., 2024; Usman et al., 2025), although a growing body of work addresses hate speech detection in other languages, including German (Demus et al., 2022; Glasebach et al., 2024; Goldzycher et al., 2024).

Figure

Figure 1: RetICL framework. Embedded training samples make up a knowledge base, from which few-shot demonstrations are retrieved, which are given to a model along with a task description (conditioning) and the post.

Detecting criminally relevant hate speech, however, introduces a further layer of complexity: models must be sensitive to the specific thresholds and distinctions encoded in (country-specific) law, a requirement that current systems only partially meet (Kums et al., 2025; Ludwig et al., 2025; Schäfer, 2023). Subtask 4 (DEF) of the GermEval Shared Task 2026 on Harmful Content Detection in Social Media instantiated precisely this challenge: classifying posts according to whether they constitute defamatory offences under §§ 185–187 StGB (German Criminal Code) (Felser et al., 2026).

Contributions. In this work, we test different prompting strategies for the detection of defamatory offences. Our RetICL framework consists of two main components (Fig. 1):

  1. The legal information on §§ 185–187 StGB that is provided to the model (Conditioning); and

  2. The retrieval mechanisms for few-shot demonstrations (Embedding and Retrieval).

The first component builds on Ludwig et al. (2025), who use prompts of differing abstraction levels—“conditioning” models on different degrees of legal knowledge—to detect whether a post falls under § 130 StGB (incitement to hatred) (Sec-tion 2.2). The second component tests different strategies for selecting demonstrations for few-shot prompting, which are also compared to zero-shot prompting. Section 2 situates our two components in prior work on legal conditioning and RetICL. Section 3 details the conditioning modes and retrieval strategies we compare, and Section 4 the experimental setups. Section 5 reports that concrete legal knowledge and few-shot prompting help, but retrieval strategy barely matters, with the full discussion of implications in Section 6.