GPT-4 的实际体验如何?和之前相比有哪些明显提升?

101次阅读

终于搞定了 GPT-4 的付费,在使用体验上是比 GPT-3.5 强的。但还是经常遇到问题,且响应速度会慢一些。我用了完全一样的要求让 GPT 给我写代码,4 写的明显比 3.5 要完善一点,但依然需要不断的自己去找漏洞和不足的地方。所谓未来会有 prompt engineer 感觉是顺理成章的事情。GPT 不会直接按照你的要求就能完成复杂的任务。更像是一个自然语言到高级语言的编译器。

过去只有少数专业人士在纸带上打孔才能让计算机干活,后来有了助记符 MOVE JUMP 之后门槛降低了很多,再之后有了高级计算机语言了更加降低了门槛,每一次都相当于把人机交互又“向上抽象了一层”,每一次抽象都把信息革命的力量在数量级上产生飞跃

GPT 让计算机干活给我一种类似的感觉,它又抽象了一层。

但它并不能真的让你不思考,只提需求,未来也许可能,目前做不到。

下面是我用 GPT-4“开发”的过程,我使用体验 依然是在开发,而不是坐享其成

我的测试用例的目标是用智能合约做一个完全去中心化的看涨期权合约。

直接把这个要求扔给 GPT,给我产生了一坨根本不能用的东西。它的理解力是有局限的。

我必须把流程给它说个明白,相当于用自然语言搞了一套伪代码。

Implement a decentralized call option using the Solidity language.
There are two roles in the smart contract: option buyers and option sellers. The workflow is as follows:
(1) The seller deposits a certain amount of ETH as collateral into the contract and sets the expiration date and strike price. At this point, the contract is established.
(2) Buyers bid and deposit an equivalent amount of ETH as the option fee guarantee into the contract. All buyer bids are visible.
(3) If the highest price observed by the seller is deemed high enough, the seller announces the end of the bidding and the contract status becomes "completed." If no buyer places a bid before the expiration date or if none of the prices are satisfactory to the seller, the contract status becomes "expired." All buyers (if any) can retrieve their bidding funds, and the seller can get back the collateral.
(4) If the contract status is "completed" and the contract expires, the buyer has the right to exchange the seller's collateral with the agreed-upon strike price after the expiration date. If the buyer pays the funds equal to or greater than the strike price as agreed, the seller receives the option premium and the cost of purchasing

大概的意思是

实现一个去中心化的看涨期权,使用 Solidity 语言。

在智能合约里有两类角色:期权买家和期权卖家

工作流程如下:
(1)卖家向合约里存入若干数量的 ETH 作为抵押物,并且设定到期日和执行价。此时合约的状态为已设立。
(2)买家竞价,并且向合约里打入自己申报的期权价格等额的 ETH 作为期权费的保证金。所有买家的竞价都是可查的。
(3)卖家观察到的价格里最高的一个如果使得卖家觉得足够高,那么卖家宣布竞价结束,此时合约的状态为已成交。如果在到期日前依然没有任何一个买家出价或者没有让卖家满意的价格,那么合约的状态为已过期。所有的买家(如果有)能拿回自己竞价的资金,而卖家能收回抵押物。
(4)如果合约状态为已成交,且合约到期,那么买家有权在到期后用约定的执行价交换走卖家的抵押物,此时买家如果如约支付大于等于执行价的资金,那么卖家提走期权费和购买抵押物的费用,而买家拿走抵押物。如果合约成交且到期后买家没有任何操作,那么 24 小时后合约状态为已失效。卖家能取回自己的质押物,且拿走买家支付的期权费。

必须要喂到这种程度,流程如下 1 2 3

有点类似大学里上课给出的编程题目之后画流程图的阶段,GPT-4 给我的输出

这是 GPT-4 给我输出的代码,乍一看,妈啊这是已经做成了。

但经不起推敲,经常给你搞一个一本正经的乱炖

我要设计的这个竞价模式,让最高出价的人成交,整个代码里连最高价的概念都没。所以 GPT 写代码的逻辑依然是相关性一通乱炖。但你说程序写的没逻辑吧,冤枉。

in the endBidding() method, seller should point the highest bidder be the winner and only the winner can exerciseOption not all of the bidders.

所以一下子完成时不现实的,必须跟它说哪里做的不对。

GPT 回复我:

I understand the requirements, and I have modified the contract accordingly. Now, the endBidding() method selects the highest bidder, and only the highest bidder can exercise the option.

它说它 understand 了,我还是很怀疑

然后给我扔了修正过的代码

是的,它没写完就挂了,经常出现 network error。

但看出来,它似乎是真的理解了我的修改意见。

但逻辑上的问题依然存在,如果 bid() 方法里已经退了该退的款,那么 calimRefund() 就不用存在了。但因为这个要求退款是我一开始提的要求,所以它一直保留着。

作为一个 prompt 的“编码者”,需要明白自己的需求会影响代码的逻辑性。

时时刻刻,逻辑的弦始终绷紧。

if in the bid() method,the bidder who failed already got the refund, then the calimRefund() method should not exists anymore

GTP 回复我:

You're correct. Since the failed bidders are already refunded in the bid() method, there's no need for the claimRefund() method. Here's the updated contract without the claimRefund() method:

它这里似乎又有对程序逻辑的判断了,还说我说的对。真不知道它是真明白了,还是对我客气。毕竟我是付费用户~

然后咔咔一顿代码修改:

这次吐出来了完整的代码,风格很完整,还有注释。

我检查了之后发现我最初给的流程里少了一个如果期权是虚的最后过期了,应该各自退还的。这个是我流程里的逻辑缺失。GTP-4 并没有发现。

但从它的代码里它似乎又是知道期权是个啥的。

另外还有一种情况,如果竞价一个都没让卖家满意,那么到期后应该自动失效,所有人拿回自己的资金。

这些都是我流程给的里面就没主义到的,GPT- 4 不会给你分析,它的逻辑是弱的

If the option is not exercised by highest bidder after 24 hours of the expiration date, it will be considered forfeited. not all of the call worth be exercised. if it be forfeited,then the premium still need paid to the seller and the seller can got back all of the collateral.
In addition, there is another situation whereby if all the bid sellers are not satisfied, all the bids will be voided upon expiration, and each buyer will receive their own funds back while the sellers will recover their own option premium margin.in this situation,the seller nerver call the endBidding() method.

这个是我继续给的 prompt,GPT-4 按照我的需求又修改了代码

Thank you for the clarification. Based on the new requirements, I have updated the smart contract to include the 24-hour exercise window after the expiration date and the new condition to allow the seller to recover their collateral if no satisfactory bids are received.

GPT 有点好,认错快又客气,作为一个乙方,态度总是很良好。

咔咔咔代码写很快,但又又又犯逻辑错误

如果期权没被成交,那么最高报价的人没收回保证金。

in the situation there are no satisfactory bids,the highest bidders's money still be locked in contract.it should pay back to the highest bidder even his/her bid is not taken.

所以 GPT 的逻辑方面是真的很欠缺。

You're right, I missed returning the highest bidder's funds in that situation. I have now updated the claimPremiumAndCollateral() method to return the highest bidder's funds if their bid is not satisfactory.

冗余重复的部分就不贴了

这次基本算对了,但总让人感觉很心虚,不知道还有啥逻辑上的伤。

它相当于 IDE 自动补足的一个非常非常非常智能的版本,但它目前不能给你实现我提需求,它直接给方案的地步,还有很长的路要走。

当你给的业务逻辑本身有毛病的时候,千万别指望它能给你指出来。哪怕你要求到比较细的地方,它依然可能在实现逻辑和严谨性上出问题。

但话说回来,这些我们手动用高级程序语言写一样要做的,它已经给你省力很多很多了不是吗?

我不用查文档,不用关心特殊的语法,不用关心 API 的名字和参数的位置等等,这个超级提示器还是极大的提升了效率的,那些逻辑问题本来也要处理的。不要抱有不切和实际的期望就好。

它直接给了你一个毛胚的房子,你得仔细检查一下水电,然后得自己装璜一下。它做不到拎包入住,但说是一个革命性的飞跃一点不为过。

未来会有 prompt engineer 的职位吧,但可能并不长寿,说不定 AI 未来直接能给你拎包入住了。

这是一个从打孔纸带到助记符级别的飞跃,会带动产业的洗牌是毋庸置疑的。

要走的路还很长,但这一步飞跃的着实惊艳。

原文链接:https://www.zhihu.com/question/589641645

正文完
 
不知道
版权声明:本站原创文章,由 不知道 2023-07-22发表,共计4881字。
转载说明:声明:本站内容均来自互联网,归原创作者所有,如有侵权必删除。 本站文章皆由CC-4.0协议发布,如无来源则为原创,转载请注明出处。