Manuscript Offprint

arXiv:2609.09552

TEFM: Token-Efficient Faithful Modeling for Structured Data

Zhichao Hou, Lingdao Sha, Xueyu Mao, Yang Liu, Peijie Qiu, Rui Song

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

Abstract

In this paper, we solve two fundamental obstacles in applying LLMs to critical domains: token efficiency and faithfulness. To address both constraints jointly, we present TEFM (Token-Efficient Faithful Modeling), a framework designed for structured data analysis in critical domains. TEFM achieves token efficiency by compressing lengthy structured observations into compact Behavioral Code tokens, dramatically reducing token consumption with minimal information loss. Moreover, TEFM enables faithful rationalization through a dual-fidelity objective that jointly optimizes code-level reconstruction and prediction-level fidelity, identifying minimal sufficient feature subsets grounded in input data. Comprehensive experiments across various domain datasets and model backbones (Qwen3, Gemma-2, Phi-4) show that TEFM achieves competitive classification accuracy with dramatic token reduction (approximately 1% token retention in clinical and 2% in security domains) while producing faithful rationales.

1 Introduction

Large language models have demonstrated remarkable capability across diverse critical domains. In healthcare, LLMs can assist diagnosis by analyzing lengthy medical records containing lab values, vital signs, and historical diagnoses (Rajkomar et al., 2018). In cybersecurity, LLMs can detect intrusions by examining network flow characteristics (Zarpelão et al., 2017). In marketplace regulation, LLMs can enforce policies by reviewing transaction histories.

As shown in Figure 1, these domains typically generate structured data such as medical records with patient vitals and lab values, or network flow logs with packet-level statistics. While conventional models (tree-based ensembles, feedforward networks) handle tabular data effectively, LLM-based approaches offer complementary advantages in safety-critical applications: (1) multimodal reasoning—combining structured data with clinical notes, incident logs, or other text without separate preprocessing; (2) in-context interpretability—LLMs naturally produce human-readable reasoning grounded in specific features; (3) unified infrastructure—organizations already deploying LLMs can leverage a single model across domains. Enabling LLMs to reason over structured data therefore opens a promising direction for safety-critical prediction.

Figure

Figure 1: Structured data examples.

∗^{*}Corresponding author.

Preprint.

However, applying LLMs to structured data introduces two fundamental obstacles:

(1) Token Efficiency. Structured data such as medical records or network logs consume excessive tokens when serialized as text. Long observation sequences quickly exhaust available context windows. The proportional cost of API calls and memory overhead make it impractical to process lengthy sequences without careful management of token consumption.

(2) Faithfulness. LLMs are prone to hallucinations and unfaithful predictions. In safety-critical domains such as healthcare and security, unreliable outputs pose severe risks: incorrect diagnoses may delay treatment, and false alerts may trigger costly interventions. Beyond accuracy alone, users require evidence that predictions are grounded in input data to support trustworthy decision-making.

Prior work has addressed these challenges separately. Context-extension approaches such as global memory tokens (Beltagy et al., 2020; Ainslie et al., 2020; Zaheer et al., 2020), sparse attention mechanisms (Child et al., 2019; Roy et al., 2021; Kitaev et al., 2020), and segment-based recurrence (Dai et al., 2019; Rae et al., 2019) modify model architecture but still scale with sequence length and suffer information loss under aggressive compression. Rationalization methods aim to identify sufficient input features (Lei et al., 2016; Bastings et al., 2019; Camburu et al., 2018; Narang et al., 2020), but most focus on NLP tasks with short free-text inputs; faithful rationalization for structured data remains largely unexplored.

This raises a fundamental question: How can we build a model that is simultaneously token-efficient, predictively accurate for high-dimensional structured data, and capable of providing faithful rationales grounded in the input?

To this end, we propose TEFM (Token-Efficient Faithful Modeling), a framework for structured data. TEFM reduces token consumption at the source with minimal information loss while providing faithful rationales grounded in input data. Our contributions are:

• A hierarchical tokenization pipeline that compresses lengthy structured observations into compact behavioral codes via Residual Quantized VAE, achieving ∼99%\sim99\% token reduction with minimal information loss.

• A two-stage training recipe: BC-text alignment pretraining integrates behavioral codes with LLM embeddings, preserving high-fidelity representations; supervised fine-tuning trains the LLM on compressed codes as a replacement for raw input, enabling token-efficient accurate predictions.

• A dual-fidelity rationalization framework that identifies minimal sufficient feature subsets by jointly optimizing code-level reconstruction and prediction-level fidelity, yielding faithful explanations grounded in input data without post-hoc perturbation.

• Comprehensive evaluation on clinical mortality prediction (MIMIC-III) and network intrusion detection (CIC-IDS2017), demonstrating competitive accuracy across diverse LLM architectures (Qwen3, Gemma-2, Phi-4), robust cross-domain generalization, and faithful rationale extraction.

The remainder of this paper is organized as follows. Section 2 describes the TEFM architecture, training methodology, and rationalization framework. Section 3 presents experimental results on clinical and security domains with thorough ablations. Section 5 discusses limitations and future directions.

References (25)