Although Emperor Wen of the Sui Dynasty established the embryonic form, the establishment and perfection of the imperial examination system were all completed in the Tang Dynasty.
It can be said that the imperial examination system was formally formed in the Tang Dynasty rather than the Sui Dynasty. According to historical records, there were about 50 subjects in the early Tang Dynasty, including Scholar, Mingjing, Jinshi, Shi Jun, Faming, Ziming and Shu Ming.
However, due to various reasons, probably in the Tang Gaozong period, the main subjects of the imperial examination in the Tang Dynasty were basically Jinshi and Mingjing, and other subjects were gradually abolished. Among them, the examination content of Jinshi is mainly current affairs strategy and poetry, while the examination content of Mingjing Classic is mainly current affairs strategy and Confucian classics.
Because the poetry examination is more difficult than the Confucian classics examination, there is a saying that "thirty old people learn Confucian classics and fifty young people", so Jinshi gradually developed into the most important subject in the imperial examination system in the Tang Dynasty. Many prime ministers after Tang Gaozong were scholars, such as Zhang Jian and Song Jing.
It is precisely because the examination of Jinshi is difficult, and the treatment after the examination is much better than other subjects, so it is natural for the literati in the Tang Dynasty to "walk on a wooden bridge with thousands of troops" and be admitted to Jinshi. Because the content of Jinshi is poetry and fu, people in the Tang Dynasty naturally focus on learning to write poems.
Because all the literati made great efforts to learn to write poetry, on the basis of a large number, the number of great poets naturally increased, so the Tang Dynasty became the peak of China's ancient poetry. However, in the imperial examinations of later dynasties, poetry was no longer the content of the examination, and it was difficult for the poems of these dynasties to reach the height of the Tang Dynasty.