I read this book for a college course about eight years ago. I think it was released before that, though.
The main character is working with someone else who has accepted a bet that they can't produce an AI that can write a better essay than a graduate student (I believe on literary analysis/criticism). The main character is the one who trains the neural network, slowly getting it to understand words and hold a conversation, until at some point it seems to become sentient.
When the time is up, the main character's lover is chosen as the competing graduate student - but instead of producing an essay, the AI prints out essentially a suicide note and erases itself from the computer system. Most others seemed to think this was a trick - I think only the main character believed the AI was actually intelligent.
I think it's set in the 80s or 90s - the AI's program is running on the college's mainframes. The AI's development is also interspersed with flashbacks and vignettes of the main character's personal life.
It seems impossible to Google this - the results are clogged with real "AI" like GPT-3 writing real "literature", and speculative articles about the future of that technology.