# Generating borderline test samples for randomness testers via intelligent optimization and evolutionary algorithms

**Authors:** Peng Gao, Bin Zhang, Ziyuan Wang, Chenglong Li

PMC · DOI: 10.1038/s41598-026-38020-w · 2026-02-04

## TL;DR

This paper introduces a new framework using evolutionary algorithms and a large language model to generate test data for randomness testers, improving the detection of subtle non-randomness in encrypted data.

## Contribution

A dynamic test data generation framework combining evolutionary algorithms and a large language model for adaptive parameter tuning in randomness testing.

## Key findings

- The framework generates high-quality borderline sequences that slightly fail randomness criteria but resemble high-entropy sources.
- The approach enables real-time parameter tuning and mitigates the curse of dimensionality in multi-objective optimization.
- Generated sequences serve as effective test inputs for real-time randomness testers.

## Abstract

Ensuring information security heavily relies on high-quality random sequences for encryption keys. Physical entropy sources, despite their use in generating true random sequences, are susceptible to environmental disturbances, necessitating real-time randomness testing to maintain high entropy. However, existing methods for generating test data for real-time randomness testers face significant challenges, including producing sequences that fail to meet specific randomness criteria, constructing borderline sequences with slight non-randomness, and addressing the difficulty of simultaneously violating multiple randomness criteria. This paper introduces a dynamic test data generation framework designed to address these challenges. The framework leverages evolutionary algorithm (EA) to transform the generation of borderline sequences into a multi-constrained optimization problem, where a large language model (LLM) acts as a dynamic parameter adjuster. By analyzing evolutionary trends in population statistics and interacting with evolutionary dynamics through a game-theoretic mechanism, the LLM adaptively adjusts scaling factors and weight coefficients, mitigating the curse of dimensionality in multi-objective optimization and enabling real-time parameter tuning. The experimental results also highlight the high quality of the generated sequences: our approach can generate borderline test data that slightly fail to satisfy the target randomness criteria, yet exhibit statistical properties very similar to those of high-entropy sources under standard test suites. These borderline sequences are fault-detectable and provide challenging, realistic test inputs for classical statistical-test-based real-time randomness testers.

## Full-text entities

- **Diseases:** LLM (MESH:D007806), GA (MESH:D030342)
- **Chemicals:** DBO (-)

## Figures

10 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12923871/full.md

---
Source: https://tomesphere.com/paper/PMC12923871