The 18-year-old fired in a 30-yard free-kick in the 35th minute after Simon Mignolet had earlier saved a tame penalty from former Leicester forward Andrej Kramaric.
James Milner's cross was then deflected into his own net by Havard Nordtveit in the second half, but substitute Mark Uth gave Hoffenheim a lifeline with an 87th-minute strike.
Benjamin Hubner could have even levelled the tie ahead of the return leg at Anfield on August 23, but missed a free header from close range in injury-time.
Hoffenheim: Baumann (6), Kaderabek (6), Bicakcic (5), Vogt (6), Hubner (5), Zuber (5), Rupp (6), Demirbay (7), Kramaric (4), Gnabry (5), Wagner (5)
Subs: Nordtveit (5), Amiri (6), Uth (6)
Liverpool: Mignolet (8), Alexander-Arnold (8), Lovren (6), Matip (6), Moreno (5), Henderson (6), Can (6), Wijnaldum (5), Salah (6), Mane (7), Firmino (5)
Subs: Milner (6), Grujic (5), Solanke (5)
Man of the match: Trent Alexander-Arnold
Instead it's Liverpool who hold the advantage, having largely looked in control of the game until a nervy final few minutes.
The Bundesliga side started the brighter and were presented with an early chance to take the lead when Serge Gnabry went down under a challenge from Dejan Lovren in the box. The referee awarded a penalty, but Kramaric's casually-taken effort was saved by Mignolet.
Mohamed Salah spurned an opportunity to add salt to Hoffenheim's wounds shortly afterwards when he shot wide with just the goalkeeper to beat.
Both sides looked to play on the front foot, but the deadlock was broken from a set-piece as Alexander-Arnold fired in a superb free-kick from around 30 yards out.
Liverpool were unchanged from their weekend draw at Watford, with Philippe Coutinho, Daniel Sturridge and Adam Lallana missing through injury.
Hoffenheim went close to levelling as Gnabry was denied by Mignolet and then Sandro Wagner struck the post with the rebound. But Liverpool also missed a chance late in the half as Lovren headed narrowly wide from a corner.
Ex-Hoffenheim forward Roberto Firmino saw a close-range effort saved after the restart, before the lively Sadio Mane was also denied by goalkeeper Oliver Baumann.
Liverpool did double their advantage in the 74th minute as Milner's cross glanced off Nordtveit's chest and went over Baumann. But, after Mignolet saved well by Nadiem Amiri, Uth pulled one back late on for the hosts with a fine strike before Hubner headed over from 10 yards out.
Man of the match - Trent Alexander-Arnold
The right-back scored a brilliant first goal for Liverpool in just his ninth start in all competitions. He also looked composed, confident and timed his runs well down the right flank to offer support to attacks.
The only blemish was his marking for Hoffenheim's goal - when he appealed for offside rather than challenge for the ball - but otherwise it was an impressive display from the teenager.