Skip to content

設計だけでは良いフィードバックを得られない

LLMを使ったコード生成で懸念すべきこと

Section titled “LLMを使ったコード生成で懸念すべきこと”

もともと自分自身は「全部のコードをLLMで生成して人間は設計だけ」論に懐疑的だが、その方向で色々な人々のコメントを集めた。正直Russと直也氏で説得力としては十分な気がする。

ACM: Ep78: Russ CoxのRuss Coxがしているコメントより。

At the same time, that worrisome side, I feel like we’re seeing a lot of people not thinking too much about the results that come out, and I think there’s a whole variety of problems with that. The one that’s maybe most relevant to Go, is that when we were doing the original design, we would write out the spec, which came first, and that was really important to us, and then we would write the program to implement the spec. When you’re writing the spec, just having to write down what the meaning is forces you to keep it simple. But then when you go to implement it, if it’s not simple to implement, then you also realize, “Oh wait, there’s something I still don’t understand about this.” And then you go back and now you say, “Oh, okay, so in this case I need to change this to this, so that it’ll be even simpler, so that the implementation will be easy and simple.” Because if the implementation is simple, then it’s usually more understandable too.

And so there’s this feedback loop between the design and the implementation back to design, back to the implementation. And if you lose that, if you can just hand something off and no matter what you hand off, it’ll get implemented, then your designs end up worse because you didn’t get that feedback to improve them. … And so I think that it’s easy with the AIs to fall into that same kind of trap, where you’ve got something that eventually will be very good at implementing things no matter what, no matter how hard it is, and you need some way to re-establish that feedback loop so that you can still get the simple designs coming out.

意訳すると、

仕様を書いて実装を進めていると、この仕様では難しいことを理解するときがある。そうすると仕様に戻ってよりシンプルな解決方法を考えて、またコードに戻ってという、設計から実装、実装から設計へのフィードバックループがある。AIで生成すると、どんなに難しい設計でも動くものが作られてしまうので、上記のフィードバックループが失われてしまって学習が得られないため、実装の結果を設計へ還元するなんらかの方法が必要になるだろう。

まあ、ここでは「手で書け」とは言っていないのだが。

ぼくは AI を使って自分の🧠を鍛えることには関心が強いけど、AI になんでも代替させることにはさほど興味がない

プレゼン資料とか、何か文書を書くとか、その内容をより深い内容にするため AI と対話して自分の理解を深めることにはめちゃくちゃ使う その資料や文書を AI に書いてもらう、ということにはほぼ使わない 資料や文書を作成する過程でこそ自分の🧠がより最適化される。それは AI に代替させない

人間は何かをインプットするときよりも、何かを出力しようとする行為の最中でこそより🧠を最適化させるんだろう、という経験からくる直感があります

「よし、完璧だ」と思ってコードを書き始めたその3秒後に「理解が浅かった」と気付くことは、いくらでもあります。コードを書き進めることで対象領域への理解が深まり、設計への良いフィードバックが返ってくる瞬間というのを、私たちは何度も経験しているはずです。

人間の設計判断能力を上げていくために必要なフィードバックは、自らの手でコードを書くことによって一番多く得られます。AI時代であっても、あえて「オーガニック・コーディング」(人間が自分の手でコーディングする)を行うことは効果的な選択です。