Title: Design of a polyphonic AI music generation algorithm based on transformer adversarial mechanism
Authors: Yujuan Li
Addresses: Music and Dance Department, Zhoukou Normal University, Zhoukou, 466001, China
Abstract: To solve the issues of structural mismatch, lack of controllability of harmony and texture, and insufficient realism of generated samples due to exposure bias in existing artificial intelligence models for polyphonic music generation, this study studies and designs a novel polyphonic artificial intelligence (AI) music generation algorithm based on transformer and adversarial mechanisms. Findings denote that the controllable choral transformer model achieves a test accuracy of up to 93.52% in the alto part, with a note error rate as low as 6.48%. The proposed model also achieves a training accuracy of 94.86%, a note-chord consistency score of 0.752, and a melody-chord pitch distance of only 0.853. The proposed algorithm, by combining relative position attention, multidimensional conditional control, and adversarial training, effectively improves the structural rationality and harmonic consistency of generated music, providing an efficient and feasible technical solution for AI-assisted music creation and personalised music generation.
Keywords: transformer; music generation; polyphony; adversarial mechanism; relative position attention mechanism.
DOI: 10.1504/IJART.2026.154951
International Journal of Arts and Technology, 2026 Vol.16 No.7, pp.74 - 96
Received: 02 Dec 2025
Accepted: 15 Feb 2026
Published online: 20 Jul 2026 *


