Transcript · English → Korean
Using AI Tools for Coding Assistance
LLM을 완전히 거부하고 처음부터 직접 쓰는 방식입니다.
이제는 이것이 아마도 올바른 방법이 아니라고 생각합니다.
제가 속한 중간 단계는 여전히 많은 것을 처음부터 직접 쓰되,
기본적으로 제공되는 모델의 자동 완성 기능을 사용하는 것입니다.
그래서 일부를 쓰기 시작하면 자동으로 완성해 주므로 그냥
탭 키를 누르기만 하면 되고 대부분은 정확합니다.
가끔 틀릴 때만 수정하면 됩니다.
하지만 여전히 작성하는 코드의 설계자 역할을 톡톡히 하는 셈이죠.
그리고 "이것이나 저것을 구현해 줘" 라고 입력해서 코딩하는 방식이 있습니다.
엔터를 치고 모델이 알아서 하게 두는 거죠.
그것이 바로 에이전트입니다.
에이전트는 매우 특정한 환경에서 작동하며 저 역시 특정 상황에서 사용할 것입니다
설정입니다.
하지만 다시 말씀드리지만, 이것들은 모두 사용할 수 있는 도구이며 그것들이 무엇을
잘하고 무엇을 못하는지, 그리고 언제 사용해야 하는지를 배워야 합니다.
그래서 에이전트들은 실제로 꽤 괜찮습니다.
예를 들어, 보일러플레이트 작업이나 보일러플레이트 코드처럼 그저 아시다시피
그저 복사해서 붙여넣는 작업 말이죠.
에이전트들은 그런 작업을 아주 잘합니다.
인터넷에서 아주 자주 등장하는 작업도 아주 잘 처리합니다.
이러한 모델의 학습 데이터에 관련 예시가 아주 많기 때문입니다.
그래서 모델이 아주 잘 수행할 수 있는 특정 기능들이 있습니다.
nano chat은 상당히 독특한 저장소이기 때문에 여기에 해당하지 않는다고 봅니다.
제가 구성한 방식으로는 코드가 그리 많지 않다고 생각합니다.
그리고 보일러플레이트 코드도 아닙니다.
실제로 지적으로 꽤 고도의 코딩 작업에 가깝고 모든 것이 아주
정밀하게 배치되어야 합니다.
그리고 모델들은 항상 그러려고 하고, 계속 그러려고 애쓰는데, 제 말은, 모델들에게는 많은
인지적 결함이 있죠, 그렇죠?
그래서 한 가지 예로, 모델들은 계속해서 코드를 오해하곤 합니다.
인터넷에 널린 일반적인 방식들에 대한 기억이 너무 많기 때문인데
저는 그런 방식을 전혀 쓰지 않고 있었거든요.
그래서 예를 들어 모델들은, 자세한 내용까지 다 말씀드려야 할지 모르겠지만,
제가 일반적인 코드를 작성하고 있다고 계속 생각하는데, 전 그렇지 않거든요.
한 가지 예를 들어보죠.
꽤 흥미로운 부분이라고 생각합니다.
한 가지 예로, 동기화하는 방식인데, 저희는 모두 순전방향 연산을 하고
역전방향 연산도 수행하는 8개의 GPU를 가지고 있습니다.
그것들 사이의 그래디언트를 동기화하는 방법은 분산 데이터 병렬 컨테이너를 사용하는 것입니다
PyTorch의 컨테이너인데, 역전파를 수행할 때 자동으로 모든 작업을 시작하여
통신하고 그래디언트를 동기화합니다.
저는 DDP를 쓰지 않았는데, 쓰고 싶지도 않았고 필요하지도 않았기 때문입니다.
그래서 빼버렸죠.
그리고 기본적으로 옵티마이저의 step 내부에 있는 저만의 동기화 루틴을 직접 작성했습니다.
그래서 모델들은 제게 DDP 컨테이너를 사용하도록 하려고 했고, 그들은 매우
걱정했습니다, 아, 이건 너무 기술적인 내용이네요.
하지만 저는 그 컨테이너를 쓰지 않았는데, 필요 없기도 했고 그것과 비슷한
커스텀 구현체를 가지고 있었기 때문입니다.
그들은 그걸 그냥 받아들이지 못했군요, 자신만의 것이 있었다는 걸요.
네, 그 부분을 넘어가지 못하더라고요.
그리고 스타일을 계속 망치려고 하더라고요 지나치게 방어적으로 굴면서요
온갖 try-catch 문을 만들며 계속 프로덕션 코드베이스로 만들려고 해요
제 코드에는 여러 가정이 들어가 있고 그래도 괜찮거든요
그냥 제게는 그런 불필요한 것들이 전혀 필요 없어요
그래서 코드베이스를 부풀리고 복잡성을 가중시킨다는 느낌이 들어요
계속 오해하고, 더 이상 사용되지 않는 API를 여러 번 사용하기도 하고요
그래서 완전히 엉망진창이에요
그리고 별로 유용하지도 않아요
제가 들어가서 정리할 수는 있지만 그리 유용하진 않죠
게다가 내가 원하는 걸 영어로 일일이 타이핑해야 하는 것도 좀 귀찮아요
타이핑할 게 너무 많으니까요
예를 들어, 제가 원하는 코드 부분으로 이동해서, 코드가
나타나야 하는 곳으로 가서 처음 세 글자를 입력하기 시작하면, 자동 완성이
그것을 파악하고 그냥 코드를 제공해 줍니다.
그래서 저는 이것이 원하는 것을 지정하는 데 있어
매우 높은 정보 대역폭이라고 생각합니다.
원하는 코드 위치를 가리키고
처음 몇 글자를 입력하면
모델이 그것을 완성해 줄 것입니다.
그러니까 제 말은,
이 모델들이 스택의 특정 부분에서 유용하다는 것입니다.
실제로 모델을 조금 사용하는 것에 있어서,
제가 실제로 모델을 사용한 두 가지 사례가
좋은 예시가 될 것 같습니다.
하나는 제가 보고서를 생성할 때였는데,
그것은 사실 상용구에 가깝습니다.
그래서 실제로 제가 그중 일부를 부분적으로 코딩했더라도
괜찮았습니다.
임무 수행에 필수적인 작업도 아니고
잘 작동하니까요.
그리고 또 다른 부분은 제가 재작성할 때였습니다
러스트로 토크나이저를요.
사실 제가 러스트를 그렇게 잘하지는 못합니다
러스트를 시작한 지 얼마 안 되었거든요.
그래서 일종의 '느낌 코딩'을 좀 하고 있었죠
러스트 코드를 일부 작성할 때 말이죠.
하지만 제가 완전히 이해하는 파이썬 구현체가 있었고
그 테스트에서 더 효율적인 버전을 만들고 있는지
확인하는 중이었습니다.
그래서 그런 작업을 할 때 더 안전하다고 느낍니다.
그래서 기본적으로 장벽을 낮추거나
혹은 언어에 대한 접근성을 높여 줍니다
잘 모를 수도 있는 패러다임에 대해서도요.
그래서 그 부분에서도 매우 유용하다고 생각합니다.
세상에는 엄청난 양의 러스트 코드가 있고
모델들이 실제로 그것을 꽤 잘하거든요.
저는 우연히도 그것에 대해 잘 모를 뿐이죠.
그래서 모델들이 거기서 매우 유용합니다.
End of transcript · 672 words · machine translated
Original transcript (English)
completely reject all of LLMs and they are just writing by scratch. I think this is probably not the right thing to do anymore. The intermediate part, which is where I am, is you still write a lot of things from scratch, but you use the autocomplete that's basically available now from these models. So when you start writing out a piece of it, it will autocomplete for you and you can just
tap through and most of the time it's correct. Sometimes it's not and you edit it. But you're still very much the sort of architect of what you're writing. And then there's the, you know, by coding, you know, hi, please implement this or that, you know, enter and then let the model do it.
And that's the agents. I do feel like the agents work in very specific settings and I would use them in specific settings. But again, these are all tools available to you and you have to like learn what they what they're good at and what they're not good at and when to use them.
So the agents are actually pretty good. For example, if you're doing boilerplate stuff, boilerplate code, that's like just, you know, just copy paste stuff. They're very good at that. They're very good at stuff that occurs very often in the internet.
Because there's lots of examples of it in the training sets of these models. So there's like features of things that where the models will do very well. I would say nano chat is not an example of those because it's a fairly unique repository. There's not that much code, I think, in the way that I've structured it. And it's not boilerplate code.
It's like actually like intellectually intense code almost and everything has to be very precisely arranged. And the models are always trying to, they kept trying to, I mean, they have so many cognitive deficits, right? So one example, they keep trying to, they keep misunderstanding the code.
Because they have too much memory from all the typical ways of doing things on the internet that I just wasn't adopting. So the models, for example, I mean, I don't know if I want to get into the full details, but they keep thinking I'm writing normal code, and I'm not. Maybe one example.
I think it's quite interesting. Maybe one example is, so the way to synchronize, so we have eight GPUs that are all doing forward backwards. The way to synchronize gradients between them is to use a distributed data parallel container of PyTorch, which automatically does all the, as you're doing the backward, it will start
communicating and synchronizing gradients. I didn't use DDP, because I didn't want to use it, because it's not necessary. So I threw it out. And I basically wrote my own synchronization routine that's inside the step of the optimizer. And so the models were trying to get me to use the DDP container, and they were very
concerned about, okay, this gets way too technical. But I wasn't using that container, because I don't need it, and I have a custom implementation of something like it. And they just couldn't internalize it, you had your own. Yeah, they couldn't get past that.
And then they kept trying to like mess up the style, like they're way too over defensive, they have make all these try catch statements, they keep trying to make a production codebase. And I have a bunch of assumptions in my code, and it's okay. And it's just like, I don't need all this extra stuff in there. And so I just kind of feel like they're bloating the codebase, they're bloating the complexity,
they keep misunderstanding, they're using deprecated APIs a bunch of times. So it's total mess. And it's just not that useful. I can go in, I can clean it up, but it's not that useful. I also feel like it's kind of annoying to have to like type out what I want in English,
because it's just too much typing. Like, if I just navigate to the part of the code that I want, and I go where I know the code has to appear, and I start typing out the first three letters, autocomplete gets it and just gives you the code. And so I think this is a very high information bandwidth
to specify what you want. If you point to the code where you want it and you type out the first few pieces and the model will complete it. So I guess what I mean is,
I think these models are good in certain parts of the stack. Actually use the models a little bit in, there are two examples where I actually use the models that I think are illustrative. One was when I generate the report,
that's actually more boilerplatey. So actually if I coded partially some of that stuff, that was fine. Because it's not like mission critical stuff and it works fine.
And then the other part is when I was rewriting the tokenizer in Rust. I'm actually not as good at Rust because I'm fairly new to Rust. So I was doing, there's a bit of vibe coding going on
in when I was writing some of the Rust code. But I had Python implementation that I fully understand and I'm just making sure I'm making a more efficient version of it in that test. So I feel safer doing that stuff.
And so basically they lower, or like the increase accessibility to languages or paradigms that you might not be as familiar with. So I think they're very helpful there as well. Because there's a ton of Rust code out there
that models are actually pretty good at it. I happen to not know that much about it. So the models are very useful there.