Diacetyl or 2,3-butanedione is a buttery (butterscotch) flavour. It provides welcome depth to some ales but is generally as welcome in lagers as a turd in a swimming pool. It is produced by yeast during the biosynthesis of the amino acid valine during fermentation. Production depends on 2 things, wort composition and yeast strain. Some yeasts only produce it when under stress or severe starvation, others fart out the stuff under most conditions.
Diacetyl is a vicinal diketone (VDK). VDKs are analysed for using a expensive lab equipment in commodity breweries. Most brewers nowadays use the phrase VDK instead of diacetyl. This is beause a few beer nerds have learned the word diacetyl and the brewers like to keep one step ahead!
Personally I hate it. I really do. It’s a sickly rotten smell which destroys the perception of freshness in beers. Pah! Like H2S a lot of people either don’t mind it or can’t taste it. I couldn’t send beer out exhibiting either stench with a clear conscience. I wouldn’t rate a beer with perceptible levels of diacetyl as any better than poor.
Some bacteria and wild yeast produce diacetyl prodigiously, so like H2S and 4VG it could indicate that your beer is off. In my opinion it certainly indicates that it’s crap.