Not sure what the state of it is now, but I saw this video of someone working on a "classifier" that recognizes when the LLM is "trying" to quote something from its training set, provides the actual data from the training, and includes citations.
They can't pull citations out of their own weights, but if you give them tools to look up man pages (possibly annotated with line numbers), they could cite the lines that support their claims.