Скуржанський Олександр ГригоровичMарченко Олександр Олександрович2024-06-112024-06-112024Скуржанськuй О. Г. Pозробка письмового асистента за допомогою сучасних нейромережевих підходів для умовної генерації тексту : дис. … д-ра філософії : 122 Комп'ютерні науки. Київ, 2024. 143 с.УДК 004.8https://ir.library.knu.ua/handle/15071834/1824Pобота присвячена дослідженню побудові нейронних мереж для умовної генерації тексту у розробці письмового асистента. У сучасному світі, де інформаційний потік набуває експоненційних обертів, виникає нагальна потреба в інноваційних технологіях для ефективної обробки та інтерпретації цих масивів даних. Вони включають у себе великі та гетерогенні набори інформації: тексти, відео, аудіо, зображення, табличні дані. Застосування традиційних методів для аналізу такої широкої та неоднорідної інформації стає неефективним, що зумовлює необхідність створення інновацій у галузі штучного інтелекту для ефективного вирішення цих викликів. У цьому контексті, однією з найбільш перспективних та впливових галузей штучного інтелекту є обробка природної мови (NLP). Значення цього напрямку сьогодні виходить далеко за рамки академічних досліджень, проникаючи у більшість сфер сучасного цифрового життя людини: від щоденної комунікації до автоматизації складних бізнес-процесів. Поява великих мовних моделей таких як ChatGPT, які не дивлячись на те що працюють виключно з текстовими даними, здійснила прорив у наближенні можливостей штучного інтелекту до людського рівня. Завдяки їхнім вражаючим здібностям до генерації контекстно-релевантного тексту відчинились шляхи для більш комплексних застосувань. Pозвиток письмових асистентів у сфері NLP набуває особливої актуальності, адже ці системи відіграють важливу роль у підвищенні продуктивності та якості щоденної комунікації. У суспільстві, зануреному в безперервний потік інформації через численні платформи, здатність до швидкого і ясного вираження думок є ключовою. Ринок письмових асистентів, з його значним економічним потенціалом, продемонстрував вражаюче зростання і за прогнозами тенденція до зростання буде зберігатися у наступні роки. Останні оцінки капіталізації напряму сягають десятків мільярдів доларів. У світлі цих викликів та можливостей, розробка власного письмового асистента в рамках дисертації стає актуальним та перспективним напрямом у галузі NLP. З розширенням сфери цифрової комунікації виникає потреба в автоматизованих системах, які б не тільки пришвидшували, але й підвищували точність комунікаційних процесів. Такий асистент має потенціал стати невід'ємним інструментом в повсякденному житті, сприяючи ефективності професійної діяльності та особистісному розвитку. Ця робота ставить за мету розробку універсального письмового асистента, що втілює в собі передові рішення у галузі нейронних мереж для вирішення комплексу задач з автоматичного виправлення граматичних та орфографічних помилок, перефразування тексту та його спрощення. Завдяки інтеграції передових технологій штучного інтелекту та машинного навчання, розроблений інструмент забезпечить більш ефективний та зручний метод обробки повідомлень для користувачів, що суттєво підвищить продуктивність та якість міжособистісної комунікації. В роботі здійснено аналіз існуючих рішень для задач письмового асистента. Детально розглянуто принцип роботи провідних практик для вирішення вищезгаданих задача умовної генерації тексту. Проаналізовано спільні риси підходів з метою побудови універсального рішення для вирішення комбінації завдань. Основним недоліком існуючих методів є їх спеціалізація на конкретних задачах, що ускладнює перенесення набутих практик з однієї задачі на іншу. Наведено аналіз методів редагування тексту на основі використання різнотипних нейронних мереж для семантичного представлення елементів тексту на рівні речень. Зазначено доцільність архітектури трансформер для проектування моделі нейронної мережі водночас розглянути згорткові та рекурентні нейронні мережі як альтернативні рішення. На основі проведеного порівняльного аналізу методів показано ефективність застосування нейронних мереж для вирішення поставлених задач письмового асистента. Згідно зі сформованими метою та задачами дисертаційної роботи побудовано архітектуру та натреновано нейронну мережу здатну виконувати задачі письмового асистента з високою якістю та ефективністю. Нижче наведені основні результати та наукова новизна. У результаті порівняльного аналізу існуючих провідних підходів до вирішення задач виправлення граматичних та орфографічних помилок, спрощення тексту та перефразування показано доцільність: • використання контекстно-орієнтованої архітектури типу трансформер у конфігурації кодування-декодування (encoder-decoder) з великою кількістю шарів уваги, попередньо натренованих на універсальних задачах відновлення зашумленого тексту або генерації; • впровадження багатоетапного тренування від найбільш частотних й найменш якісних даних до найбільш якісних; фільтрація тренувальних даних завдяки моделям винагороди. Вперше запропоновано метод комбінованої оцінки якості роботи письмового асистента, який узагальнює ключові показники ефективності та адекватності текстових виправлень. Виконано дослідження існуючих провідних робіт на найбільш репрезентативних тестових вибірках для відповідних задач. Аналіз результатів свідчить що не всі метрики корелюють з людською оцінкою якості роботи моделей і нагальне застосування нормалізуючих коефіцієнтів для збалансованої комбінації задач. Крім того, завдяки аналізу літератури виявлено, що деякі задачі більш важливі для письмового асистента ніж інші. Tак задача виправлення граматичних та орфографічних помилок є найважливішою згідно з очікуваннями користувачів. Створено новий тренувальний набір даних з нуля для задач виправлення граматичних та орфографічних помилок, спрощення тексту та перефразування. Застосовано сучасний підхід з використанням великих мовних моделей. За допомогою ретельно підібраних текстових запитів (prompts), згенеровано переписування передовою моделлю ChatGPT, використовуючи існуючі набори даних як вхідні речення; крім того утворені переписування автоматично оцінено з точки зору рівня переписування іншою великою мовною моделлю LLaMA-2 задля покращення якості фінального набору даних. Далі показано, що згенеровані дані суттєво покращують якість індивідуальних та універсальних моделей на тестових вибірках. Проведено велику кількість експериментів з метою побудови оптимальної конфігурації для тренування нейронних мереж здатних виконувати окремі задачі письмового асистента: 1. натреновано індивідуальну baseline нейронну мережу для кожної із згаданих вище задач; 2. проведено порівняльний аналіз отриманих моделей відносно існуючих провідних підходів; 3. оцінено вплив параметрів тренування (темп навчання, кількість кроків, оптимізація тренування, розклад, розмір батча); 4. розглянуто різні типи нейронних мереж й архітектури та їхній вплив на фінальну якість моделі; 5. використано різні існуючі набори даний та їх комбінування під час тренування, багатоетапність підходу; 6. проаналізовано різні попередньо натреновані моделі та проведено власні спроби попереднього тренування; 7. оцінено вплив використання набору даних згенерованого великими мовними моделями. Проведено експерименти з комбінування завдань письмового асистента для єдиної універсальної мета-моделі. Застосовано різноманітні підходи: тренування спеціалізованих токенів векторних представлень, поділ шарів нейронної мережі на спільні (перевикористані між задачами) та індивідуальні (для окремих задач), використання арxітектури адаптерів. Проаналізовано отримані універсальні системи на запропонованій комбінованій метриці. Вираxовано ефективність підxодів з точки зору кількості параметрів на задачу та одиницю якості. Оптимізовано фінальну універсальну модель з метою пришвидшення її роботи, з уникненням суттєвої втрати якості на задачаx письмового асистента та комбінованої метрики. Розглянуто різноманітні стратегії такі, як квантизація вагів у формати нижчої точності, розподілене виведення, ефективне управління пам'яттю, дистиляція знань. Tакож проведено аналіз програмниx бібліотеки для пришвидшення генерації тексту як ONNX.The work is devoted to the study of building neural networks for conditional text generation for the development of efficient writing assistant. In today's world, where the flow of information is gaining exponential momentum, there is an urgent need for innovative technologies to effectively process and interpret these data sets. They include large and heterogeneous sets of information: texts, videos, audio, images, and tabular data. The use of traditional methods to analyze such broad and heterogeneous information is becoming inefficient, which necessitates the creation of innovations in the field of artificial intelligence to effectively address these challenges. In this context, one of the most promising and influential areas of artificial intelligence is natural language processing (NLP). The importance of this field today goes far beyond academic research, penetrating most areas of modern digital life: from daily communication to automation of complex business processes. The emergence of large language models such as ChatGPT, which, despite working exclusively with textual data, has made a breakthrough in bringing artificial intelligence capabilities closer to the human level. Their impressive ability to generate contextually relevant text has opened the door to more complex applications. The development of NLP-based writing assistants is particularly relevant, as these systems play an important role in improving the productivity and quality of daily communication. In a society immersed in a continuous flow of information through numerous platforms, the ability to express thoughts quickly and clearly is key. The market for writing assistants, with its significant economic potential, has demonstrated impressive growth, which is projected to continue its upward trend in the coming years. Recent estimates of the market capitalization reach tens of billions of dollars. Beyond the scope of textual data, the realm of natural language processing is rapidly expanding into multimodal AI, which integrates text, image, and audio processing to create more comprehensive and intuitive systems. This integration reflects the way humans communicate and process information, involving various sensory inputs. With the advancement of multimodal AI, systems can now interpret visual cues alongside textual information, enhancing understanding and interaction. This capability is particularly transformative for industries such as healthcare, where AI can analyze medical images in conjunction with clinical notes to aid in diagnostics, and in customer service, where chatbots can understand and respond to visual and verbal cues, creating a more human-like and satisfying user experience. The integration of these complex functionalities is not only a technological triumph but also a step towards more natural and efficient human-computer interaction, with applications that were previously unattainable in the field of artificial intelligence. In light of these challenges and opportunities, developing your own writing assistant as part of your dissertation is becoming a relevant and promising area in the field of NLP. With the expansion of digital communication, there is a growing need for automated systems that would not only speed up but also increase the accuracy of communication processes. Such an assistant has the potential to become an indispensable tool in everyday life, contributing to professional efficiency and personal growth. This work aims to develop a universal writing assistant that embodies advanced solutions in the field of neural networks to solve a set of tasks for automatically correcting grammatical and spelling errors, paraphrasing text, and simplifying it. By integrating advanced artificial intelligence and machine learning technologies, the tool aims to provide a more efficient and convenient way to improve user messages, which significantly increases the productivity and quality of interpersonal communication. The paper analyzes existing solutions for writing assistant tasks. The principle of operation of the leading practices for solving the above-mentioned tasks of conditional text generation is considered in detail. The common features of the approaches with the method of building a universal solution for solving a combination of tasks are analyzed. The main disadvantage of existing methods is their specialization in specific tasks, which makes it difficult to transfer the acquired practices from one task to another. The article analyzes the methods of text editing based on the use of different types of neural networks for the semantic representation of text elements at the sentence level. The expediency of the transformer architecture for designing a neural network model is noted, while convolutional and recurrent neural networks are considered as alternative solutions. Based on the comparative analysis of methods, the effectiveness of using neural networks to solve the tasks of a writing assistant is shown. In accordance with the goal and objectives of the thesis, the architecture was built and the neural network was trained to perform the tasks of a writing assistant with high quality and efficiency. Below are the main results and scientific novelty. As a result of a comparative analysis of existing leading approaches to solving the tasks of correcting grammatical and spelling errors, simplifying text and paraphrasing, the expediency of • use of a context-aware transformer-type architecture in an encoder-decoder configuration with a large number of attention layers pre-trained on universal tasks of noisy text recovery or generation; • implementation of multi-stage training from the most frequent and lowest quality data to the highest quality data; filtering of training data using reward models. For the first time, a method of combined evaluation of the quality of a writing assistant's work is proposed, which summarizes the key indicators of efficiency and adequacy of text corrections. A study of existing leading works on the most representative test samples for the relevant tasks is carried out. The analysis of the results shows that not all metrics correlate with human evaluation of the quality of the models' performance and that it is necessary to apply normalization factors for a balanced combination of tasks. In addition, the literature analysis revealed that some tasks are more important for a writing assistant than others. For example, the task of correcting grammatical and spelling errors is the most important according to users' expectations. A new training dataset was created from scratch for the tasks of grammatical and spelling error correction, text simplification, and paraphrasing. A state-of-the-art approach using large-scale language models was applied. Using carefully selected textual prompts, rewrites are generated by the advanced ChatGPT model using existing datasets as input sentences; in addition, the generated rewrites are automatically evaluated in terms of rewrite quality by another large language model LLaMA-2 to improve the quality of the final dataset. Furthermore, it is shown that the generated data significantly improves the quality of individual and universal models on the test sets. A large number of experiments have been conducted to build an optimal configuration for training neural networks capable of performing individual tasks of a writing assistant: 1. an individual baseline neural network was trained for each of the above tasks; 2. a comparative analysis of the obtained models in relation to the existing leading approaches; 3. the influence of training parameters (learning rate, number of steps, training optimization, schedule, and batch size) was evaluated; 4. different types of neural networks and architectures and their impact on the final quality of the model are considered; 5. different existing datasets and their combination during training, multi-stage approach are used; 6. analyzed various pre-trained models and conducted our own pre-training attempts; 7. the impact of using a dataset generated by large language models was evaluated. Experiments were conducted to combine tasks of a writing assistant for a single universal meta-model. Various approaches were used: training specialized tokens of vector representations, dividing the layers of the neural network into common (reused between tasks) and individual (for individual tasks), and using the architecture of adapters. The resulting universal systems are analyzed using the proposed combined metric. The effectiveness of the approaches in terms of the number of parameters per task and quality unit is calculated. Finally, the resulting model is optimized to speed up its operation, avoiding a significant loss of quality on the tasks of a writing assistant and the combined metric. Various strategies are considered, such as quantizing weights into lower-precision formats, distributed inference, efficient memory management, and knowledge distillation. We also analyze software libraries for accelerating text generation such as ONNX.ua: обробка природної мовиумовна генерація текстунейронна мережазгорткова нейронна мережарекурентна нейронна мережаарxітектура трасформервиправлення граматичниx та орфографічниx помилокспрощення текступерефразуваннявелика мовна модельмета-модельадаптерnatural language processingconditional text generationneural networkconvolutional neural networkrecurrent neural networktransformer architecturegrammar and spelling correctiontext simplificationparaphrasinglarge language modelmeta-modeladapterPозробка письмового асистента за допомогою сучасних нейромережевих підходів для умовної генерації текстуDevelopment of efficient writing assistant using modern neural network approaches for conditional text generationДисертація