Ziyi Ni
2026
P-QuASAR: A Unified Probabilistic Framework for Holistic Patent Quality Assessment and Refinement
Xinyuan Song | Ziyi Ni | Fred Yang | Bo Zhang | Yijin Wang | Jane Zhang
Findings of the Association for Computational Linguistics: ACL 2026
Xinyuan Song | Ziyi Ni | Fred Yang | Bo Zhang | Yijin Wang | Jane Zhang
Findings of the Association for Computational Linguistics: ACL 2026
Automated assessment of patent quality is increasingly important given the growth of patent filings and the adoption of AI-assisted drafting. Existing methods often rely on modular pipelines or generic detectors, resulting in fragmented decisions and limited integration across quality dimensions. We propose P-QuASAR (Patent Quality Assurance via Structured Assessment and Refinement), a unified probabilistic framework that represents patent specifications as Quality Graphs. Multiple interdependent quality dimensions—such as regulatory compliance, technical coherence, and figure–text consistency—are jointly modeled using uncertainty-aware Quality Assessment Functions with learned edge potentials. Cross-dimensional evidence propagation via loopy belief propagation enables calibrated defect detection, while Optimal Intervention Paths translate inferred quality states into prioritized and actionable refinement recommendations. Evaluated on 500 patents across eight IPC domains against seven state-of-the-art baselines, P-QuASAR achieves substantial improvements: 99.86% balanced accuracy on regulatory compliance, 88.91% on technical coherence, and 94.70% on figure consistency, outperforming the strongest baselines by 3.0%, 9.0%, and 7.1%, respectively. Ablation studies confirm that joint graph reasoning contributes 3.66 points to average performance. When applied for refinement, P-QuASAR reduces average defects in AI-generated patents from 9.04–12.15 to 3.21 per document, surpassing human-authored patents.
TiMem: Temporal-Hierarchical Memory Consolidation for Long-Horizon Conversational Agents
Kai Li | Xuanqing Yu | Ziyi Ni | Yi Zeng | Yao Xu | Zheqing Zhang | Xin Li | Jitao Sang | Xiaogang Duan | Xuelei Wang | Chengbao Liu | Jie Tan
Findings of the Association for Computational Linguistics: ACL 2026
Kai Li | Xuanqing Yu | Ziyi Ni | Yi Zeng | Yao Xu | Zheqing Zhang | Xin Li | Jitao Sang | Xiaogang Duan | Xuelei Wang | Chengbao Liu | Jie Tan
Findings of the Association for Computational Linguistics: ACL 2026
Long-horizon conversational agents have to manage ever-growing interaction histories that quickly exceed the finite context windows of large language models (LLMs). Existing memory frameworks provide limited support for temporally structured information across hierarchical levels, often leading to fragmented memories and unstable long-horizon personalization. We present TiMem, a temporal–hierarchical memory framework that organizes conversations through a Temporal Memory Tree (TMT), enabling systematic memory consolidation from raw conversational observations to progressively abstracted persona representations. TiMem is characterized by three core properties: (1) temporal–hierarchical organization through TMT; (2) semantic-guided consolidation that enables memory integration across hierarchical levels without fine-tuning; and (3) complexity-aware memory recall that balances precision and efficiency across queries of varying complexity. Under a consistent evaluation setup, TiMem achieves state-of-the-art accuracy on both benchmarks, reaching 75.30% on LoCoMo and 76.88% on LongMemEval-S. It outperforms all evaluated baselines while reducing the recalled memory length by 52.20% on LoCoMo. Manifold analysis indicates clear persona separation on LoCoMo and reduced dispersion on LongMemEval-S. Overall, TiMem treats temporal continuity as a first-class organizing principle for long-horizon memory in conversational agents. The code is available at https://github.com/TiMEM-AI/timem.
SafetyMem: Adaptive Jailbreak Defense via Dual-Component Safety Memory
Hao Wang | Ziyi Ni | Huacan Wang | Pin Lyu | Lei Sha
Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Hao Wang | Ziyi Ni | Huacan Wang | Pin Lyu | Lei Sha
Proceedings of the 64th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)
Current defenses for Large Language Models (LLMs) often suffer from a ”memory gap”: parameter-modifying methods are computationally rigid, while inference-time filters cannot retain or reuse defense knowledge across interactions. To address this, we propose SafetyMem, a novel framework that secures LLMs through a dual-component safety memory system. SafetyMem consists of Semantic Safety Memory (SSM), which consolidates diverse jailbreak attempts into a structured knowledge base of attack patterns, and Episodic Safety Memory (ESM), which maintains an evolving set of procedural rules refined from historical detection failures. Unlike static defenses, SafetyMem allows the model to ”remember” and adapt to emerging adversarial strategies without parameter retraining. To further enhance robustness, we introduce an adversarial memory expansion mechanism that proactively generates challenging variants to solidify these memories. Experiments on standard and stealthy jailbreak benchmarks show that SafetyMem substantially reduces attack success rates while preserving efficiency and interpretability, consistently outperforming state-of-the-art baselines across multiple LLMs.
2025
Tree-of-Code: A Self-Growing Tree Framework for End-to-End Code Generation and Execution in Complex Tasks
Ziyi Ni | Yifan Li | Ning Yang | Dou Shen | Pin Lyu | Daxiang Dong
Findings of the Association for Computational Linguistics: ACL 2025
Ziyi Ni | Yifan Li | Ning Yang | Dou Shen | Pin Lyu | Daxiang Dong
Findings of the Association for Computational Linguistics: ACL 2025
Solving complex reasoning tasks is a key real-world application of agents. Thanks to the pretraining of Large Language Models (LLMs) on code data, recent approaches like CodeAct successfully use code as LLM agents’ action, achieving good results. However, CodeAct greedily generates the next action’s code block by relying on fragmented thoughts, resulting in inconsistency and accumulative hallucination. Moreover, CodeAct lacks action-related ground-truth (GT), making its supervision signals and termination conditions questionable in multi-turn interactions. To address these issues, we propose Tree-of-Code (ToC), a self-growing framework that generates nodes through self-supervision, incorporating prompt and model exploration in a GT-free setting. Each node employs CodeProgram, an end-to-end code generation paradigm that aligns executable code logic with global reasoning. This approach uses task-level execution success as both node validity and stop-growing flags, bypassing process supervision to enable online applications. Experiments on two datasets with ten popular zero-shot LLMs show that ToC boosts accuracy by nearly 20% over CodeAct with fewer than 1/4 turns. To further investigate the trade-off between efficacy and efficiency, ablation studies on different ToC tree sizes and exploration mechanisms validate ToC’s superiority.
2024
Mitigating Training Imbalance in LLM Fine-Tuning via Selective Parameter Merging
Yiming Ju | Ziyi Ni | Xingrun Xing | Zhixiong Zeng | Hanyu Zhao | Siqi Fan | Zheng Zhang
Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing
Yiming Ju | Ziyi Ni | Xingrun Xing | Zhixiong Zeng | Hanyu Zhao | Siqi Fan | Zheng Zhang
Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing
Supervised fine-tuning (SFT) is crucial for adapting Large Language Models (LLMs) to specific tasks. In this work, we demonstrate that the order of training data can lead to significant training imbalances, potentially resulting in performance degradation. Consequently, we propose to mitigate this imbalance by merging SFT models fine-tuned with different data orders, thereby enhancing the overall effectiveness of SFT. Additionally, we introduce a novel technique, “parameter-selection merging,” which outperforms traditional weighted-average methods on five datasets. Further, through analysis and ablation studies, we validate the effectiveness of our method and identify the sources of performance improvements.