Fuzzy-Logic Adaptation of Sliding Window Parameters in Data Preparation for Large Language Models

Main Article Content

Maxim Vladimirovich Bobyr
Natalya Anatolyevna Milostnaya

Abstract

The article proposes a fuzzy regulator for calculating sliding window parameters to prepare training data for Large Language Models. The traditional approach sets the stride and context length parameters as fixed constants, uniform for the entire text, and does not account for the linguistic characteristics of individual fragments, such as dense scientific text and monotonous, repetitive text. The proposed method utilizes two automatically computed features of a fragment: lexical diversity and the average BPE token length. Based on the Mamdani algorithm with a base of 9 fuzzy logic rules and defuzzification using the center of gravity method, the fuzzy regulator adaptively calculates the stride and context length values for each fragment. The proposed approach has a cognitive interpretation, as it mimics the mechanism of adaptive human attention during reading, for example, complex fragments are processed more attentively with a small stride size.

Article Details

How to Cite
Bobyr, M. V., N. A. Milostnaya, and S. Y. Belskaia. “Fuzzy-Logic Adaptation of Sliding Window Parameters in Data Preparation for Large Language Models”. Russian Digital Libraries Journal, vol. 29, no. 4, July 2026, pp. 1318-37, doi:10.26907/1562-5419-2026-29-4-1318-1337.

References

1. Brown T., Mann B., Ryder N. et al. Language models are few-shot learners // Advances in Neural Information Processing Systems. 2020. Vol. 33. P. 1877–1901.
2. Touvron H., Lavril T., Izacard G. et al. LLaMA: Open and efficient foundation language models // arXiv preprint. 2023. arXiv:2302.13971. https://doi.org/10.48550/arXiv.2302.13971.
3. Rashka S. Build a Large Language Model (From Scratch) // Manning Publications. 2024. 368 p. ISBN 9781633437166.
4. Radford A., Wu J., Child R. et al. Language models are unsupervised multitask learners // OpenAI Blog. 2019. Vol. 1(8). P. 9.
5. Zadeh L.A. Fuzzy sets // Information and Control. 1965. Vol. 8(3). P. 338–353.
6. Mamdani E.H., Assilian S. An experiment in linguistic synthesis with a fuzzy logic controller // International Journal of Man-Machine Studies. 1975. Vol. 7(1). P. 1–13.
7. Gupta Y., Saini A., Saxena A. Fuzzy logic-based approach to develop hybrid similarity measure for efficient information retrieval // Journal of Information Science. 2014. Vol. 40(6). P. 846–857. https://doi.org/10.1177/0165551514548989
8. Prabowo R., Thelwall M. Sentiment analysis: A combined approach // Journal of Informetrics. 2009. Vol. 3(2). P. 143–157.
9. Bobyr M.V., Milostnaya N.A., Bondarenko B.A., Bobyr M.M. Experimental Study of HSV Threshold Method and U-Net Neural Network in Fire Recognition Task // Automatic Documentation and Mathematical Linguistic. 2025. Vol. 59(4). P. S313–S320. https://doi.org/10.3103/S0005105525701225
10. Rayner K., Pollatsek A. The Psychology of Reading. Lawrence Erlbaum Associates. 1989. 529 p.
11. Jang J.-S.R. ANFIS: Adaptive-network-based fuzzy inference system // IEEE Transactions on Systems, Man, and Cybernetics. 1993. Vol. 23(3). P. 665–685. https://doi.org/ 10.1109/21.256541
12. Bobyr M.V., Arkhipov A., Emelyanov S., Milostnaya N. A method for creating a depth map based on a three-level fuzzy model // Engineering Applications of Artificial Intelligence. 2023. Vol. 117. https://doi.org/10.1016/j.engappai.2022.105629


Most read articles by the same author(s)