There’s no character on TV quite like Erlich Bachman. Pompous, vulgar, pedantic, and yet strangely endearing — T.J. Miller’s unique creation has been a highlight of HBO’s razor-sharp tech industry satire “Silicon Valley” since the first season. But in the current third season, Erlich is being cut down to size, and it’s not pretty. In “Bachmanity Insanity,” he throws a blowout bash to celebrate the launch of his new company, inviting all of his enemies to lord his success over them. And then he discovers he’s broke. A natural-born improviser, Miller talks — and riffs — us through his work.

“Silicon Valley” (HBO)

Season 3, episode 6, “Bachmanity Insanity”

Written by Carson Mell, directed by Eric Appel

T.J. MILLER: “I think Thomas Middleditch is fine with me comparing our work styles to one another — we have a strange approach where we don’t read the scripts until the table read. The first time I read the script is out loud at the cold read. There’s a very specific reason I do that, I’m guaranteed to laugh harder. That’s better for us with the executives, and the writers can get a good sense of what’s working. Usually, Thomas and I will not read the script again maybe until the day of [shooting].

“With this particular one, I remember thinking, ‘This is going to be a disaster for Erlich.’ It gets really sad for Erlich this season, we’re beginning to see that if [the Pied Piper guys] don’t need him around, nobody really wants to be around him. All the things that make us love him are also the same things that make everyone who watches the show not really want to know him.

“Sometimes after [standup] shows people will be like, ‘Dude, I want to hang out with you, I hope you’re exactly like Erlich.’ I’m like, ‘I hope not.’ It’s this weird thing of people saying, ‘I want to hang out with you because I want to hang out with Erlich,’ but when they find out the ways I’m like Erlich it’s like, ‘Yikes, I don’t know if I want to be chilling with you all the time.’ That’s what we’re seeing happen with the character. He’s a hyperbolic version of certain aspects of my personality.

“I’ve added a regalness to [Erlich], which is from my experience with tech people and pseudo-intellectuals. It’s kind of like Groucho Marx when he’s in the world of the socialites.” T.J. Miller

“I’ve added a regalness to him, which is from my experience with tech people and pseudo-intellectuals. It’s kind of like Groucho Marx when he’s in the world of the socialites. There’s a lot of that in Erlich.

“Because I have some training in dramatic acting, even though my focus has always been and will always be comedy, I made [the final moment, when Erlich realizes he’s broke] a little too maudlin the first few takes. I asked the director, ‘Can I just do one more that’s really quick?’ I wanted it to dawn on [Erlich] all in one fell swoop how fucked he is. All the people in this room, many of whom hate him, are going to laugh for the rest of their lives at this idiot.

“I got on stage and opened my mouth to say something and for the first time you see Erlich speechless. All he does is close his mouth. That is such a weird, sad moment for the character. I’d get in my car after shooting and I would be depressed on the way home. I didn’t know where the season was going.

“We did the math and we found out [the amount of improv] exactly falls to 39 to 59% — we had an analyst look at it. The joke I’m doing right now is scripted.”

“On ‘Silicon Valley’ the scripts are really solid, but each of us improvises — Martin [Starr], Kumail [Nanjiani], everybody — they’re so talented, it’s ‘an embarrassment of riches’ as [co-showrunner] Alec Berg said one time. It’s true. Because they let us riff, each of the characters have become very much our own creation. No one can come up with riffs about Jared the way Zach Woods can, because he is strangely in his head. He loves the darkness of his backstory and all that stuff.

“Propers to all the writers for putting us in situations where we can do what some of us do best, which is riffing.