Skip to content

DP-MIND: Memory-Guided Differentially Private Long-Context ReasoningDP-MIND: Differentially private memory-guided Long context Inference

arXiv· arXiv:2610.13132· Zhihao Liu, Yitian Cheng, Shuang Liu, Rui Wen, Yuke Hu, Zhan QinZhejiang University; Ant Group; Institute of Science Tokyo; King Abdullah University of Science and TechnologyIndexed by this site · 24 days ago· Originally publishedDefenses

Quick read

Defenses

Based on the paper PDF (AI-generated); refer to the original

The authors propose DP-MIND, which uses chunked DP perturbation plus memory propagation for million-token-level private inference; the authors state that on RULER-HQA at ϵ=7 and 1.8M, SubEM is 59.38.

Threat modelUsers access an external LLM through LLM-as-a-Service and need to submit long contexts containing sensitive information; DP-MIND locally applies token-level dχ-privacy perturbation to the context, so the external LLM can only see the perturbed chunks and the memory derived from the perturbed content, while the clean context and the alignment table Π remain in the trusted local environment.

Questions
LLM-as-a-Service requires users to send long contexts that may contain sensitive information to a remote model. The authors state that existing DP inference methods are mainly designed for short contexts and face problems of context capacity, utility degradation, and inference overhead at the million-token scale.
Methods
DP-MIND applies token-level DP perturbation to the context locally, chunks it, queries an external LLM chunk by chunk, and maintains a compact memory; it trains the memory policy on perturbed data with RL that combines answer correctness and memory consistency, then locally restores the perturbed segments in the answer according to an alignment table.
Experiments and results
Evaluated on RULER-HQA and NIAH, with ϵ=6/7/8, at up to 1.8M tokens. The authors state that DP-MIND outperforms baselines under all settings, for example at ϵ=7 and 1.8M, SubEM is 59.38, while Long-Context Scaling is 0.00; it also maintains its advantage under SanText and InferDPT perturbation.
Limitations and future work
The paper does not specifically discuss limitations. The experiments cover two model scales, Qwen2.5-7B/14B, two benchmarks, RULER-HQA and NIAH, three budget levels, ϵ=6/7/8, and three perturbation mechanisms; each setting has 128 samples, and the paper does not report the number of repetitions or statistical significance tests.
Experimental setupQwen2.5-7B、Qwen2.5-14B · RULER-HQA、NIAH · SubEM、EM et al.
Evaluated models
Qwen2.5-7BQwen2.5-14B
Benchmarks
RULER-HQANIAH
Metrics
SubEMEMF1
AI summaryAddressing the privacy risk when users send queries containing sensitive or confidential content to large language model services, researchers propose the DP-MIND framework, which extends differentially private inference to million-token-level long contexts. Methodologically, the input is first perturbed locally, then processed chunk by chunk, and a compact memory preserves task-relevant information across sequences; the authors use reinforcement learning to directly optimize the memory construction strategy on the perturbed input, guided by final-answer correctness and memory consistency, and then use a local denoising module to recover answer spans damaged by the perturbation, without exposing the original context to the external model. The paper provides a theoretical privacy analysis and experiments on multiple long-context benchmarks with context lengths up to one million tokens, with results showing that DP-MIND consistently outperforms existing DP and long-context inference baselines in both scalability and utility.

Addressing the privacy risk when users send queries containing sensitive or confidential content to large language model services, researchers propose the DP-MIND framework, which extends differentially private inference to million-token-level long contexts. Methodologically, the input is first perturbed locally, then processed chunk by chunk, and a compact memory preserves task-relevant information across sequences; the authors use reinforcement learning to directly optimize the memory construction strategy on the perturbed input, guided by final-answer correctness and memory consistency, and then use a local denoising module to recover answer spans damaged by the perturbation, without exposing the original context to the external model. The paper provides a theoretical privacy analysis and experiments on multiple long-context benchmarks with context lengths up to one million tokens, with results showing that DP-MIND consistently outperforms existing DP and long-context inference baselines in both scalability and utility.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    How to extend differential privacy inference to million-token long contexts while controlling the utility loss caused by DP noise.

    Core question: In the LLM-as-a-Service setting, how can differentially private (DP) inference be performed on sensitive contexts at the million-token scale while maintaining usability.

    • Problem setting: Users submit prompts and context documents to a remote model through LLM-as-a-Service; the context may contain sensitive information such as private conversations, medical or financial records, source code, and legal documents. The authors consider this to pose a risk of privacy leakage.
    • Shortcomings of existing methods: The authors state that existing DP inference methods (such as DP-Forward, InferDPT, Split-and-Denoise) are mainly designed for short or medium-length contexts and do not address the three problems brought by million-token inputs: context lengths beyond the model's effective processing capability, utility degradation caused by DP noise, and inference overhead.
    • Core observation: Non-private long-context methods (context window extension, sparse attention, memory-augmented inference) have demonstrated the feasibility of long-context extension, but the authors argue that they are designed for clean inputs and cannot cope with the information corruption caused by DP perturbation, and that compression and memory construction may also propagate noise errors.
    • Proposed approach: DP-MIND, a memory-guided DP long-context inference framework: local perturbation followed by chunked sequential querying of an external LLM, RL optimization of the memory policy on perturbed data, local denoising to restore answer segments, and a theoretical privacy analysis.
    • Threat model:
      • Protected object: the long context submitted by the user to the external LLM, which may contain sensitive or confidential information.
      • Defense mechanism: token-level perturbation satisfying εdχ-privacy is applied to the context in a trusted local environment, and the external LLM only receives the perturbed chunks.
      • Trust boundary: the clean context and the perturbation alignment table Π always remain local; the external LLM can only see perturbed chunks and memory states derived from perturbed content.
      • Victim system: the paper does not set an attacker role; the goal is to prevent the remote model provider from accessing the clean context.
  2. What related research exists?

    Related work is divided into two categories, DP inference and long-context inference; the authors state that the former does not cover million tokens and the latter does not consider DP noise.

    Differentially Private Inference

    • Early text perturbation methods: Feyisetan et al. (2020) and Xu et al. (2020) inject calibrated noise into token embeddings and project back to discrete tokens; SanText (Yue et al., 2021) and CusText (Chen et al., 2023a) improve private text perturbation through natural token replacement and customized output sets.
    • LLM inference protection: DP-Forward (Du et al., 2023) perturbs input representations during the forward pass; ObfusLM (Lin et al., 2025) combines embedding obfuscation and shuffling to defend against embedding inversion attacks; SharedRequest (Mai et al., 2026) performs batch-level request sharing; DP-Fusion (Thareja et al., 2026) performs token-level DP.
    • Utility recovery and multi-turn: Split-and-Denoise (Mai et al., 2024) and InferDPT (Tong et al., 2025) introduce denoising and response extraction, respectively; DP3 (Zheng et al., 2026) addresses privacy budget consumption and semantic consistency in multi-turn inference. The authors state that these methods do not systematically solve the scalability and utility problems under million-token contexts.

    Long-Context Inference

    • Context window extension: Position Interpolation (Chen et al., 2023b), YaRN (Peng et al., 2024), and LongRoPE (Ding et al., 2024) expand the usable context length through position interpolation or rescaling.
    • Sparse attention: Longformer (Beltagy et al., 2020) and BigBird (Zaheer et al., 2020) use local, global, or random attention patterns to reduce the quadratic cost of full attention.
    • Memory-augmented inference: MemAgent (Yu et al., 2026) uses recurrent memory updates and reinforcement learning for long-context inference; LycheeMemory (Chen et al., 2026) combines chunk compression, selective memory retrieval, and end-to-end RL. The authors argue that these methods are designed for clean inputs, and that under DP perturbation, expanding the window or reducing attention complexity cannot repair corrupted evidence.

    Baselines and Benchmarks

    • Baseline methods: standard Qwen2.5-7B/14B (baseline), Sparse Attention (Longformer-style local sliding-window attention), Long-Context Scaling (direct inference with Qwen2.5-7B-Instruct-1M), Memory-Augmented (chunked querying plus recurrent memory propagation; the ablation includes MemAgent, i.e., RL MemoryAgent).
    • Benchmarks: RULER-HQA (constructed based on HotpotQA following the RULER protocol) and NIAH (the needle-in-a-haystack setting of RULER).

    The authors position this paper as: to their knowledge, the first systematic study of DP inference at the million-token scale, bringing memory-augmented inference into a previously underexplored direction in the DP literature.

  3. How does the paper address this problem?

    After local DP perturbation, query the external LLM in chunks and propagate memory, optimize the memory policy with RL, and restore the answer via local alignment denoising.

    Overall approach: DP-MIND (Differentially Private Memory-guided INference with local Denoising) applies token-level DP perturbation to the long context locally, chunks it, queries an external LLM chunk by chunk, and uses a compact memory state to pass task-relevant information between chunks; the memory policy is optimized directly on perturbed inputs with reinforcement learning; finally, the perturbed segments in the answer are restored locally using a clean-perturbed alignment table.

    Chunked DP Memory Inference

    • Perturbation and chunking: The long context C is divided into N consecutive chunks, and the local perturbation mechanism MDP acts on the entire context to obtain perturbed chunks (C1′, …, CN′); the external LLM only receives the perturbed chunks.
    • Sequential memory update: Starting from M0 = ∅, the memory is updated chunk by chunk as Mi ← LLM(Mi−1, Ci′, Q), and finally ADP ← LLM(MN−1, C′N, Q) generates the DP answer; this expression indicates that the final answer depends only on the previous memory, the last perturbed chunk, and the query.
    • Privacy boundary: The memory is computed only from perturbed chunks and existing memory, and never touches the clean context.

    Privacy Analysis

    • Perturbation mechanism: metric DP (dχ-privacy) is adopted; Laplacian noise is added to token embeddings and then projected back to the nearest token in the vocabulary (Algorithm 3 in Appendix A).
    • Theorem 4.1: The authors prove that the entire external inference process (chunking, sequential querying, memory updates, answer generation) is post-processing of MDP, and therefore MDP−MIND and MDP satisfy the same εdχ-privacy; the basis is the post-processing property of DP (Dwork & Roth, 2014).

    Local Answer Denoising

    • Alignment table: During perturbation, a token-level alignment Π = {(wt′, wt)} is recorded locally and kept only in the trusted local environment.
    • Segment restoration: Restoration rules are built for aligned segments of length at most K, including only perturbed segments whose clean counterparts are unambiguous; the DP answer is scanned and the longest match is replaced first, yielding Afinal ← Denoise(ADP, Π, K).
    • Design constraint: Denoising only performs alignment-based segment replacement and does not regenerate the answer; the authors state that this step does not leak additional information to the external LLM.

    DP-Aware Memory Policy Optimization (RL)

    • Total reward: Rfinal = Rans + λ Rmem, where λ controls the weight of the memory consistency reward.
    • Answer reward Rans: Acc(Afinal, Y) is computed on the denoised final answer, directly optimizing the end-task utility of the full pipeline.
    • Memory consistency reward Rmem: A reference policy πref is used to build a clean memory trajectory on clean inputs; after locally denoising the DP memory, the negative average of the L2 distance between the two embeddings is taken, encouraging the DP memory to be close to the clean reference.

    Implementation Details (Appendix A)

    • Chunking and generation: chunk size 5,000 tokens (the last chunk may be shorter), memory initialized to "No previous memory", each memory update generates at most 1,024 tokens; temperature 0.7, top-p 0.95.
    • Prompts: The memory update prompt requires integrating information relevant to the question in the current chunk and retaining old memory; the final answer prompt requires answering using only the DP memory; Appendix A.3 gives the full templates.
  4. What experiments did the paper conduct?

    Evaluated on RULER-HQA and NIAH, with ϵ=6/7/8, at up to 1.8M tokens; the authors state that DP-MIND outperforms baselines under all settings.

    Experimental Setup

    • Models evaluated: Qwen2.5-7B and Qwen2.5-14B (Yang et al., 2024); long-context extension uses the corresponding Qwen2.5-1M variants (supporting about 1M tokens).
    • Benchmarks: RULER-HQA (multi-hop QA constructed from HotpotQA following the RULER protocol, 7K to 1.8M tokens, 128 samples per length); NIAH (RULER's needle-in-a-haystack, with Single, Multi-Key and Multi-Query variants, 32K/128K/512K, 128 samples per length).
    • Baselines: Qwen2.5-7B/14B standard baseline, Sparse Attention (Longformer-style local sliding window), Long-Context Scaling (Qwen2.5-7B-Instruct-1M direct inference), Memory-Augmented (chunked querying plus recurrent memory propagation).
    • Metrics: EM (exact match after normalization), F1 (token-level overlap), SubEM (counted correct if the prediction contains the complete normalized gold answer span); for multiple gold answers, the maximum is taken; DP-MIND is evaluated after denoising.
    • Privacy settings: three budget levels, ϵ = 6, 7, 8; default dχ-privacy perturbation (Feyisetan et al., 2020), with two additional perturbation mechanisms, SanText and InferDPT, also tested.
    • Samples and repetitions: 128 samples per experimental setting; the paper does not report the number of repetitions or statistical significance tests.

    Main Results

    SubEM at ϵ=7 on RULER-HQA (according to Table 1; "–" indicates the method cannot handle that length):

    Swipe horizontally to read the table

    Method7K28K56K224K448K896K1.8M
    Qwen2.5-7B (baseline)47.6640.62–––––
    Sparse Attention47.6640.626.250.00–––
    Long-Context Scaling46.0942.9745.3126.569.380.00–
    Memory-Augmented58.5944.5330.4729.6927.3421.0917.97
    DP-MIND75.7871.0973.4470.3171.8864.8159.38
    • Handled lengths: The authors state that DP-MIND is the only method usable across the full 7K–1.8M range; the standard baseline supports only up to 28K, Sparse Attention up to 224K, and Long-Context Scaling relies on the 1M variant model with an expanded window.
    • Utility comparison: At ϵ=7, Long-Context Scaling drops from 45.31 at 56K to 0.00 at 896K and 1.8M, while DP-MIND maintains 73.44, 64.81 and 59.38 at the corresponding lengths; the authors argue that merely extending the window or using sparse attention is insufficient under DP perturbation.
    • Other budgets and metrics: At ϵ=6, DP-MIND's SubEM at 1.8M is 39.06, and at ϵ=8 it is 63.28 (Table 1); full results for F1 and EM are in Table 4 and Table 5, with consistent trends.

    Generalization at 14B Scale

    • What was tested: Re-evaluation with Qwen2.5-14B on RULER-HQA at ϵ=7 (Figure 3 and Tables 6–8).
    • Results: DP-MIND's SubEM goes from 81.31 at 7K to 70.31 at 1.8M, higher than Memory-Augmented (33.59 at 1.8M) and Long-Context Scaling (17.19 at 448K, not reported at 1.8M) at all lengths (Table 8).
    • Authors' interpretation: The authors state that DP-aware RL and local denoising remain effective from 7B to 14B, and that the advantage of the memory framework grows as the context lengthens; the main text states that the gap at 1.8M is about 19.5 SubEM points.

    NIAH Retrieval Task

    • What was tested: Three NIAH variants (Single, Multi-Key, Multi-Query), 32K/128K/512K, ϵ=6/7/8 (Figure 4, Table 9).
    • Results: At ϵ=7 and 512K, DP-MIND achieves 36.72/35.16/38.09 on Single/M-Key/M-Query, versus 19.53/3.91/2.93 for Qwen2.5-7B-1M; at ϵ=6 all methods are very low (DP-MIND is 5.47 on 32K Single).
    • Authors' interpretation: The authors state that DP-MIND consistently outperforms the baselines across perturbation strengths and lengths, and that its advantage grows as the retrieval context lengthens; at ϵ=6, strong noise makes retrieval difficult for all methods.

    Ablations and Robustness

    • Component ablation (Table 3, RULER-HQA, ϵ=7, SubEM): Chunk-only drops from 58.59 at 7K to 0.00 at 1.8M; RL MemoryAgent (MemAgent) is 56.25 at 1.8M; DP-RL MemoryAgent (trained on DP-perturbed data) is 57.81; full DP-MIND (with local denoising) is 59.38.
    • Perturbation mechanism robustness (Table 2): Under the three perturbations dχ-privacy, SanText and InferDPT, DP-MIND is higher than Qwen-1M at 56K–448K; the SubEM improvements at 448K are 62.50, 68.75 and 64.07 percentage points, respectively.
    • Chunk size (Figure 5): The authors state that 5K–10K chunks give better EM and SubEM across lengths, and that 20K degrades in the very-long range; larger chunks reduce the number of recurrent steps and thus lower per-sample time.

    Other Ablations and Analyses

    • Low utility of all methods at ϵ=6: On RULER-HQA, Sparse Attention is already 0.00 at 224K, and DP-MIND is 39.06 at 1.8M (Table 1).
    • Memory-Augmented fluctuation at short context: At ϵ=7, Memory-Augmented is 58.59 at 7K and drops to 41.41 at 14K (Table 1); the paper does not explain this fluctuation.
    • Long-Context Scaling at 14B not reported at 1.8M: In Tables 6–8, the 1.8M column for this row is "–".
  5. What are some points that can be further explored?

    The paper does not specifically discuss limitations; the experiments cover two model scales, two benchmarks, three ϵ levels and three perturbation mechanisms.

    Limitations and Future Directions Noted by the Authors

    The paper does not specifically discuss limitations. There is no Limitations or Future Work section in the main text, conclusion, or appendix, nor any sentence explicitly stating "this is a limitation/future work."

    Scope of Experimental Coverage

    • Models tested: two scales, Qwen2.5-7B and Qwen2.5-14B; the long-context baseline uses Qwen2.5-7B-Instruct-1M (Section 5.1).
    • Benchmarks and tasks: RULER-HQA (multi-hop QA, 7K–1.8M tokens) and NIAH (Single/Multi-Key/Multi-Query retrieval, 32K–512K), both synthetic benchmarks from the RULER family (Section 5.1, Appendix B.1).
    • Privacy settings: three budget levels, ϵ = 6, 7, 8; perturbation mechanisms cover three types: dχ-privacy, SanText, and InferDPT (Table 1, Table 2).
    • Sample size: 128 samples per experimental setting (Appendix A.2, B.1); the paper does not report the number of repetitions, confidence intervals, or statistical significance tests.
    • RL training details: The paper gives the reward composition (Rans, Rmem, λ) but does not report the value of λ, the training algorithm, the training data scale, or the specific model settings used for training.
  6. Summarize the main content of the paper

    DP-MIND uses chunked DP perturbation, memory propagation, RL memory optimization and local denoising for million-token-level private inference.

    A paper on privacy-preserving long-context inference: addressing the problem that in LLM-as-a-Service, users must submit sensitive long contexts to a remote model, it proposes the DP-MIND framework, with the goal of simultaneously guaranteeing differential privacy and inference utility at the million-token scale.

    • Problem addressed: The authors state that existing DP inference methods target short or medium contexts and face three problems with million-token inputs: insufficient context capacity, utility loss caused by DP noise, and inference overhead; non-private long-context methods do not consider DP perturbation.
    • Method highlights: Locally apply token-level dχ-privacy perturbation to the context and chunk it; the external LLM processes it chunk by chunk and maintains a compact memory; an RL objective combining answer correctness (Rans) and memory consistency (Rmem) is used to train the memory policy on perturbed data; after inference, the answer span is restored locally using the clean-perturbed alignment table. The authors prove that the overall external inference is post-processing of the perturbation mechanism and preserves the same εdχ-privacy.
    • Main results:
      • RULER-HQA, ϵ=7: DP-MIND's SubEM at 1.8M tokens is 59.38, while Long-Context Scaling is 0.00 at 896K and 1.8M (Table 1).
      • At ϵ=8 and 7K, DP-MIND's SubEM reaches 80.47, higher than the four baselines at every budget and length (Table 1).
      • On Qwen2.5-14B at ϵ=7 and 1.8M, SubEM is 70.31; the authors state the method generalizes to larger scales (Table 8).
      • Under the SanText and InferDPT perturbation mechanisms, the SubEM improvements over Qwen-1M at 448K are 68.75 and 64.07 percentage points, respectively (Table 2).
      • On NIAH at ϵ=7 and 512K, DP-MIND's three variants are 36.72/35.16/38.09, higher than Qwen2.5-7B-1M's 19.53/3.91/2.93 (Table 9).
    • Authors' conclusion: The authors state that memory-guided inference preserves utility in million-token DP scenarios, demonstrating the effectiveness of this direction for scalable private LLM inference; the authors state that this is the first systematic study of DP inference at the million-token scale.
Read originalarxiv.org