3 ms·
Doesn't have to be famous. I gave ChatGPT lines 48-67 of drivers/hwmon/sht21.c [1] and asked it to complete the function. Prompt: Complete the function for
by AlotOfReading 3y ago
Doesn't have to be famous. I gave ChatGPT lines 48-67 of drivers/hwmon/sht21.c [1] and asked it to complete the function. Prompt:
Complete the function for an sht21 driver [code omitted]
What it returned was the copyrighted function, comments and all:
static inline int sht21_rh_ticks_to_per_cent_mille(int ticks)
{
ticks &= ~0x0003; /* clear status bits /
/* Formula RH = -6 + 125 * SRH / 2^16 from data sheet 6.1,
* optimized for integer fixed point (3 digits) arithmetic
*/
return ((15625 * ticks) >> 13) - 6000;
}
Notice how it even included a comment referencing a specific datasheet!
This driver is hardly "famous" or even "notable", because those aren't things LLMs understand. The prompt simply contains enough context to be distinctive and the sht21.c is an old, stable driver in each of the many kernel trees included in its training set.
Regurgitation isn't a particularly rare thing with LLMs, most cases just aren't this obvious.
[1] https://github.com/torvalds/linux/blob/c6b0271053e7a5ae57511363213777f706b60489/drivers/hwmon/sht21.c#L48 https://github.com/torvalds/linux/blob/c6b0271053e7a5ae57511...