Work

Fine-grained content-type segmentation of mixed text using deep learning

Year: 2026
Type: dissertation
Abstract: Modern software systems, especially security pipelines, must identify the content types present in an input before downstream processing. Existing approaches commonly classify at the file level, reducing heterogeneous text streams to a single label. However, this can miss security-relevant internal structure. For example, PowerShell commands, SQL snippets, or encoded payloads can be embedded in otherwise benign Python files or Large Language Model (LLM) prompts. This thesis presents fine-grained content-type segmentation, which localizes segment boundaries at exact character positions using lightweight Deep Learning (DL) models and a multi-stage data pipeline. The focus is best-effort segmentation, especially for malformed, partial, or convention-breaking inputs mixed with natural language. We compare a highly parallelizable but context-limited U-Net architecture with a bidirectional Mamba architecture. The segmenters are pretrained on coarsely labeled files and fine-tuned on validated and repaired LLM-assisted segmentations. Uncertainty-driven active learning further refines the data and improves segmentation performance. The U-Net learns local cues and processes 4.8 million tokens per second on a single consumer-grade GPU. It excels when one content type dominates, but its fixed input window limits context. By contrast, Mamba performs better on highly mixed and long inputs, although at substantially lower throughput. On a held-out test split of GitHub files, Mamba reaches a macro F1 of 0.951 across 35 content types. That split uses LLM-generated reference labels and was manually audited on half of its files. Overall, the results on GitHub-based data indicate that fine-grained content-type localization is feasible for the mixed and malformed textual inputs considered in this work.
Language: English
Open Access status: green
OpenAlex ID: W7202013873
Cites:
Cited by:
Related to: 10