Morning Spinach, May

2023-05-05

  • もう五日ですか・・・。
  • 夜型への移行を試みたが失敗し、寝不足など生活の乱れなどで発熱クラッシュし昨日は欠勤。今日は回復してきたが気力がなく欠勤。来週からは復帰したい。
  • 諸事情により寝室から kicked-out されてしまうので、リビングで作業する環境をつくりたい。ということでいくつか方法を考えたが、寝室のデスクトップの vscode server にリビングのラップトップからつなぐ方法を試してみる。いちおうシェルも使える。ターミナルはしょうもないくらい遅いが・・・。
  • 一年ぶりくらいに duckdb 活動をしてしてみようかとクローンしてビルド。
  • 最近どんなかんじなのかとビデオを冷やかす。
    DuckCon 2023 – State of the Duck – Mark Raasveldt and Hannes Mühleisen – YouTube
  • めっちゃ開発進んでんな。もうコード読んでもわからないのではと不安。
  • MotherDuck インテグレーションのためにめちゃ複雑さが高まりそうな話を以前聞いていたのが、それが起きている。たとえば AST を直列化するコードが入っている。ZetaSQL ならともかく君たちは in-process のデータベースじゃないのかい。Proto 的なのをつかわず直列化とか地獄である。そしてこのシリアライザは素人か・・・。このひとたちはデータベースの実力はワールドクラスだが他は素人っぽいのだよな・・・。
  • まあコードを漫然と眺めていてもはかどらないのでバグでも眺めましょう。
  • Issues · duckdb/duckdb
  • 550 open. このくらいでまったくビビらないのが大企業人材であるところのわたくしです。
  • 一年前は何らかの方法でこれを整形してマークダウンかなんかにしたような気がする。Markdown がいいかはさておきデータを手元に持ってきて分析したほうがよさそうなのは確かである。
  • 記録をみるとGH コマンドをつかっている。なるほど。
  • 今回は・・・前回同様 MD -> Docs といきますかね。つまりコマンドそのままもってくればよい。なお前回は 300 くらいだったらしい。
  • できた: DuckDB Issues
  • Docs にコピペ Morrita’s DuckDB Issue Traige May 2023 – Google Docs
  • とりあえずタイトルからして興味がないのを strike-through していくべし。
  • というわけでトリアージを続けているが、2021 年分すら終わりません・・・。

2023-05-06

  • 体調不安から朝はスキップしたが夕方にちょっと時間ができた。トリアージなので細かいじかんですすめるべき(家計簿のトリアージはいいのか?)
  • VSCode server 経由で terminal は tunnel server 代とかいらなくて便利なんだけど、遅いなあ。やはり managed で native な ssh tunning がほしくなる。そんなんあるんか。-> あるが、とてもじゃないけど信頼できませんわ。我慢だな。

2023-05-08

  • 自分の体調が回復したとおもったら今度は妻子が風邪。ここしばらく家族で不調。
  • 出社の前にちょっとだけトリアジる試み。
  • 先日「閉じたら?」とコメントしておいたバグのいくつかは担当により閉じられていた。Bot が必要。
  • 2021 年分は終了しました・・・。2022 年分を見終わったら直し始めようかな。なお半分くらいは 2023 である。もしかしたら 2023 も眺めたほうがいいのかもしれないが、それは 2022 終了時点での気力をもって判断すべし。

2023-05-10

  • 六月分までみて 130/550 とかなんだけど、なんかバグの増加ペース速くない?
  • バグも割としょうもないのが多く、自分が直せそうのが沢山あるのはいいんだけど品質管理に不安を覚える。単純に質が低いというよりは、機能が多すぎるのだよな。そして機能同士が独立してなくて相互作用があるので、複雑さが爆発するという。ほんとにブラウザ的である。
  • ただブラウザと比べ API や機能の追加にめちゃおおらかなので、どんどん機能の surface が肥大化していく。このまま 1.0 に突入して大丈夫か?ちょっと scale back したほうがよくない?
  • Intern の子が duckdb にバカスカコミットしてるのをいて、はーワシもどっかで気楽にインターンとかしたいもんだわ、と思うものなり。当人は別に気楽じゃないんだろうけれども。
  • たぶんマイナー機能の実装が half-baked なのだろうね。世の中色々 half-baked なものはいっぱいあるのでとやかく言うものではないが、データベースで half-baked だとユーザはちょっと不安になってしまうのではないか。
  • CSV reader まわりはしょうもないバグが多い割にユーザが結構いて、直しがいがありそうである。
  • 160/550 まできた。目標の 330 までは道半ばである。

2023-05-11

  • 朝ちょっとだけ進めて 179/550. この人たちに必要なのは TPM だな・・・。

2023-05-12

  • 04:23.
  • needs-reply label が必要だと思うんだけど、あれデフォルトじゃないんだね。
  • DuckDB Lab, 名門大学発だけあって DB 人材に事欠いてないのはすごいね。いるところ(=データベースの研究室)にはいるよなー。
  • 2022 の終わりまで残り 100 件 aka 一カ月半まで来ました。しかし一カ月半で 100 件とか、なかなかのペースだね。これ破綻してしまわないか。
  • ちなみにもう 20 個くらい “閉じられるよ” といって close している。自分の感覚だとこの x3 くらい閉じていいかんじだが、そういう価値判断は保留して単なる閉じ忘れだけでこの件数・・・やはり TPM が・・・というかわたくしにクローズ権限くれたらやりますよ・・・。
  • はっきり閉じられるやつはさておき、議論が stall したり WAI ですよ、とやんわり伝えているが伝わっていなかったり、ビルドが通らないなどのサポート窓口になっているがサポートされている側が蒸発、みたいのが邪魔。
  • 今週中にはおわらせたかったが、明日明後日と早起きできるかは怪しいのであった。というか明後日は外出の用事があるからダメだな・・・。

2023-05-13

  • 04:19. カフェインなどなくても早く寝れば早く起きられるのである。
  • 2022 年分トリアージ終了!276 件すなわち半分以下でした。もう半分も軽く眺めてやってもいい気はするが、その前に直せそうな候補を整理してみようではないか。
  • Morrita’s DuckDB Fixlist May 2023 – Google Docs
    既に何十個も候補バグがある。これで既に年内いっぱいくらいヒマつぶせるわ。1 bug per week として 20 個くらいだからねせいぜい。まあ古いバグなので半分くらいは obsolete でしょうが、それでも十分。2023 はほっといてバグ直しやってみるべし。
  • 時間切れ。
  • さて子が同級生の BD とかで微妙に時間があるぞ。とりあえず fork を clone のちビルドすべし。
  • full build で 90 秒! 速いマシンを買った甲斐があったねー。
  • なんか様々なノウハウがあった気がするが忘れかかっている。その手のドキュメントを整備欲しいというバグがあったが、まずは自分用チートシートの構築が先である。
  • DuckDB Dev Cheatsheet by Hajime Morita そのうち contrib しませうね。
  • Adding column with type ENUM fails when schema is not main · Issue #3076 · duckdb/duckdb
    最初のターゲットはこれです!明らかにバグ~というかんじなので。
  • まだ再現するかな? -> した。ところで CREATE TYPE って前なかったよね。ENUM 以外でも発生するのかな?ためすべし。
  • そして documentation もないねー・・・。直して理解した暁には書いてやってもよいかもしれない。
    PG にもある: PostgreSQL: Documentation: 15: CREATE TYPE
  • 適当なサンプルを試すが動かない。ENUM 以外サポートされてんのかなこれ・・・。
  • duckdb/create_type.y at master · duckdb/duckdb · GitHub
    ENUM か typedef 的なのだけサポートしている。

2023-05-15

  • 04;27. 月金は通勤ランがないので朝に軽く筋トレをしてみるものなり。
  • さて・・・typedef 的 type でも同じ問題があるので、これは alter table における type lookup の問題です。テストケースを作ってデバッグすべし。
  • というわけでテストを書くと、ASAN で死ぬわ・・・。
  • ところでコードをみると STRUCT, LIST(?), UNION も 扱えそうな雰囲気である。シンタックスがわからんが。テストケースには追加する必要があるでしょう。ついでに use type のネストもできる。再帰とか大丈夫かな・・・(大丈夫だな)。
  • ASAN はバグではあったが本題とは関係なかった。
  • なんか色々問題があるな・・・ 1) GetLogicalType() に降ってくる schema が ALTER しようとしているテーブルの schema である。これは、あってるといえばあってるが、そこを探すので良いのか?妥当なサーチオーダーは 1. テーブルの schema -> デフォルトの schema -> システムの schema とかではないのだろうか。2) そもそも user type の schema を指定できない。つまり “ALTER TABLE test_schema.test_t1 ADD COLUMN j memory.main_int” と書けない (“memory.” が不正). これは syntax をさぼっているためである。あとで直すべし。
  • というわけでまず search order をなんとかすべきだが、そのロジックどっかにないんですかね。なんか昔そのへん直した気がするのだがまったく覚えていない。
  • 名前の lookup をさがすと・・・てきとうである(おもいだしてきた)。
  • https://github.com/duckdb/duckdb/pull/6141 ここでデフォルトの fallback を雑に実装している。これは特に根拠なさそうだな。適当に loosen すればよさげ。
  • CatalogEntryLookup Catalog::LookupEntry() に unused code. あとで消す・なおす。
  • 適当に lax にするだけでは治らず。
  • VSCode のデバッガを試してみると動くが・・・なんか xSAN 関係でクラッシュしがちだなあ。デバッグ中は SAN を切れということですかね。
  • step in できない・・・。
  • 時間切れ。

2023-05-17

2023-05-18

2023-05-19

  • 04:34. 手早く心拍を上げるために縄跳びをしてみたら 300 回飛んだだけで 150. これは手軽でよいのではないか。
  • さて・・・ Podcast 準備するかな。

2023-05-20

  • 04:40. 今日は 400 回とんでみた。腕が重い。
  • つづき。

2023-05-22

  • 04:50. 縄跳びし過ぎで腕が筋肉痛のため今日はあとで走りに行こうと思います・・・。
  • ひきつづき準備。

2023-05-23

  • 04:34. 軽く腕立て腹筋したのち、縄跳びを 100 回ごとに休憩をはさみ 700 回。400 回でくたばると運動量が足らないとおもってインターバル方式にしてみたけど、これだと心拍数が 120-130 くらいまでしかあがらず微妙。150 までいきたい。次回は 200 回で区切るべし。
  • さて週末したり Podcast 準備したりしているうちに PR がぜんぶマージされてました!めでたい。今日はフォローアップで CREATE TYPE で qualified name を使えるようにします。Grammar をさわらないといけません。
  • この bison/flex で生成したコードをチェックインするの、ほんとやめてほしいなしかし。一方でバージョンとかがめんどいというのは理解できるので、こういうツールこそ wasm にしてバイナリをチェックインし、クロス環境で実行できるようにしてほしいもんだわ。
  • なんかこの文法は直感的にはおかしいよな。STRUCT とかは TypeName の producdtion なのに、ENUM だけここにハードコードされている。一方で ENUM は SELECT から定義できるという狂った仕様をサポートされているらしく、それだと TypeName に入れるのは厳しいのもわかる。つまり… SQL is crazy, as always.
  • さてどこをいじるべきか…と PR を見直すと、直すべきは CREATE TYPE ではなく ALTER TABLE だった。
  • さて微妙・・・。GenericTypeName はコメントに反して qualified name をサポートしていない。一方 SELECT とかで使われる qualified name は quote とかをサポートしている。ALTER TABLE ADD COLUMN i “my_scheme.my_int” とか書けてしまうのはいいのか?まあ別にいいか(てきとう)・・・。
  • ていうかさ、cataloname.schemaname.columname は OK だが thereis.no.nested.schemanae.here なのか。つまり dot は二つまで。SQL is crazy as always….
  • そして下手に GenericType で qualified name をサポートしてしまうと、TypeName を使っている場所すべてで qualified name に対処しないといけなくなる。これはそれなりに big change じゃないですか。いきなり PR を送り付けるのもアレなのでいちおう Issue を file しておくか。
  • まず PG で挙動を確認すべし。
  • なんか CREATE TYPE myint AS numeric; とかいう時点で既に PG 互換じゃなくない? PG は CREATE TYPE mytype AS (intval AS numeric); みたいな composite type はサポートしているけど typedef 的な用途はサポートしてないよねこれ。一方の Duck は STRUCT はサポートしているが PG のような伝統的 data type はサポートしてない。互換性考慮する必要なし。
  • Feature Request: Support qualified name in TypeName · duckdb/duckdb · Discussion #7643
  • 時間切れ。

2023-05-24

  • 05:05. 目覚ましつけわすれ 😦
  • さて .y いじってくぞ。
  • これ型名だけじゃなく関数名も qualify できないっぽいな・・・。
  • うーむできん。時間切れ。やや大がかりなリファクタリングをしないといけなさげ。
  • 具体的にはいままでは雑に grammar.y に埋め込んであったコードを、grammar.y から呼ばれている C++ の “backend” 関数からアクセスできるようにしないといけない。めんどくさいな・・・。
  • 本来なら .cpp に置きたい関数をテンプレートにして .hpp におき、依存したい関数は引数で渡すか・・・。

2023-05-31

  • 05:15. 起きられず。そして WP で一週間分(といっても寝過ごし多数のため実質二日分くらい)の記録が消えてしまった。WP ちゃん・・・あんたにゃ autosave が必要だよ・・・。
  • この時間じゃなんもできないけど、せめて失われたコンテクストを取り戻し翌日に備えるべし。
  • なんだっけ? ALTER TABLE の奇妙なシンタックスの理解を深める必要があった。PG のマニュアルでも見てみるか。
  • “ALTER [ COLUMN ] column_name SET ( attribute_option = value [, … ] )” これだな・・・。
  • “SET ( storage_parameter [= value] [, … ] )” というのもあるな。
  • Bison のでだした counterexample をみると
    “First example: ALTER TABLE relation_expr SET ‘(‘ ColLabel ‘=’ IDENT • ‘.’ attr_name ‘%’ TYPE_P ‘)’ $end”
  • その文法 PG になくない・・・?
  • Duck でためしてみると
    “ALTER TABLE tbl SET(foo = bar);”
    -> NotImplementedException: Not implemented Error: ALTER TABLE option not supported yet!
  • ALTER TABLE tbl ALTER i SET(foo = bar); もおなじ。
  • つまり実装されてもおらず PG にも storage_parameter くらいしか使われていないしょーもないエッジケースである。ので、多少表現力を弱くしてもばちはあたるまい。
  • なお同じ文法をつかう CREATE TABLE tbl2 (i int32) WITH (foo = bar); は動くが・・・、おめーそれエラーチェックしてないだけだろ。CREATE VIEW, CREATE INDEX も同様のオプションをサポートしている(文法レベルでは)。
  • しかし PG のマニュアルをみると・・・けっこう色々できるね。ストレージに渡すオプションらしい。Duck がエラーをチェックしてないのは確かだが、ここが柔軟な dict になっていてほしいのは事実の模様。ただ key = value の右辺 def_arg が option の指定でそんなに厳しい必要ないだろ・・・とおもったら constraint の指定と文法をシェアしているらしい。ここで constraint 用と create/alter 一族用の表現力に差をつければいいのではないか?
  • 時間切れ。明日は早起きしたいですね・・・。
  • ていうか五月おわっちゃったよ。
  • DuckCon に申し込んでいたが、なんとその日は子の学校の林間学校、というかキャンプで親同伴なのだった。はー Duck 勢がわざわざオランダから来てくれるというのに残念。しかし親業というのはそういう楽しみをポイポイ投げ捨てながらやるものなのです。

明日

  • かるく筋トレ
  • ↑つづき

Vision Pro

Apple Vision Pro – Apple

I am super impressed. It’s appealing.

I have no idea how well it will sell, or whether it is the “future of computing”. It can be. I wouldn’t pretend I know anything.

I am impressed, firstly because it is ambitious. They are trying to build another computing platform. It is not either an iPhone accessory (Watch) or a large screen iPhone (iPad). It is a totally different thing, and in theory it can kill existing platforms, like desktop computers.

Well, Meta’s Oculus is as ambitious. However their “vision” has too much distance from their reality. The second reason for the impressiveness comes from the technical achievement. Although we don’t know how well it works in practice, the technologies they showed off are novel and interesting enough. It is also very sophisticated. It demonstrates the strength of Apple both as an innovator and as a big company. I haven’t felt that immense technical feat from other Big Tech peers for a while.

It feels exciting. and that excitement feels good. Things like AI and LLM are exciting for sure, but as an old person it’s a bit hard to relate to these. The new computing platform is a more “traditional” new thing. It might sound weird, but this excitement feels familiar. The computing platform was supposed to change for like every decade. That moment might finally have arrived. We all have waited so long.

This familiarity gives me some comfort, even though I’d never code on this new platform. Apple fanboys will have a good time for the coming few years, and I’m jealous. And feeling jealous of the competing platform is strangely energizing. Computing platforms become less boring thanks to this. Hey competitors, work hard to catch up!

Every Day Is Mother’s Day

Did do you anything special for Mother’s Day, I asked. “No. My culture doesn’t celebrate Mother’s Day, but…” He continued “To me, every day is Mother’s Day.” Why? “I call my mom every day anyway.”

A twenty-something me might have ridiculed him. But this forty-something me would give him pure respect. Such a routine is not my character, but that character is not something I’m proud of. What is the relationship like when you do it? It’s beyond my imagination.

I called my mom and told the story. She was politely impressed, as she always is. We had a brief conversation after that, then said goodbye.

Today is a Mother’s Day. I know tomorrow wouldn’t, but next Wednesday maybe it is.

Link: Twenty Years of Blogging | Hacker News

Twenty Years of Blogging | Hacker News

Looking at my back number, the oldest entry was in Nov. 16, 2003. So my blogging also has lasted almost twenty years.

I vaguely remember I had an even older “blog” or web site, but that’s something I’d rather cancel, so let’s pretend it’s almost twenty-years old. It is still a long time.

While reading these old diaries, various feelings come back to my mind. It is love, it is an embarrassment, it is an excitement, it is boredom, it is despair… It feels a bit overwhelming every time these back number titles show up in front of me. I appreciate my younger self captured the moment I lived, on the Internet.

A Hacker News comment says:

The best time to start blogging was twenty years ago. The second best is today – having a personal blog is an investment that just keeps on compounding over time, even if you only post things there a few times a year.

https://news.ycombinator.com/item?id=35881356

I no longer consider blogging as an investment. To me, it becomes more about keeping the light on. It is like a tradition, like writing a holiday card, or like repairing an old car and driving it on July fourth.

My writing isn’t as interesting or as forthcoming as before, but still I don’t want to throw every present moment away into Ether, even if they are banal. I left little during the pandemic, and such an abandonment made me sad. I don’t want that again. So let’s keep the light on.

L

A bot sent me a pull request that removes an ACL entry of ok e of my former teammates L which, the bot claims, becomes invalid. He left the company says the PR.

Not hearing a good bye is fine as we weren’t friends but were just peers, but getting notified by a bot never feels great. I just threw the PR away and close the tab.

L was an industry veteran. One day he told me that his first job was programming on a PDP-11, the computer UNIX was invented. I was so excited to hear that and asked him if he programmed in C. The answer was no. “It was too early.” said him – It was obvious in retrospect. There were many other stories like this, many of which I forgot unfortunately. This particular one still sticks to my mind and shines like a gem.

L probably retired from his long career. Thinking about that gives me a moment of warm feeling – Retiring in Silicon Valley! It is such an accomplishment.

L and his peers came to the company through an acquisition, and their culture was very different from the one of the acquirer; They were always talking about politics at lunch (and they were Republicans), they were loud, they occasionally used F and S words. Still they were more tight-knit than any other teams I have experienced here.

L was rough even among the peers. Sometimes it made him hard or unpleasant to work with.

L grew up in Kansas, got his education on the east coast (MIT!) and worked in a government related job, then road-tripped to California to start a new one. He had stories and characters. And I loved them, even though I was occasionally annoyed by his behaviors. He was rough, like his stories.

It felt like America. A different version from mine, which is a variation of Bay Area stereotype – Asian dense, financially stable, gentle but transactional. I like my version, but I also preach the version I briefly witnessed.

Recently Listening

The Gift of Failure

A parenting book. The author criticizes parental over-protection and argues that parents should let children do their things and let them fail to learn. These points feel similar to the ones made in How to Raise an Adult by Julie Lythcott-Haims. It is however geared towards being more concrete, whereas Julie’s is more like an opinion piece.

Also, this can be interpreted as a variation of the “natural consequences” approach of modern parenting, introduced by books like Positive Discipline, but extending it to a non-disciplinary context which becomes more important as children grow.

The author mentions books like Grit, Mindset, and Drive – a self-help category I dubbed “Contemporary Guts Theories”. These connections are interesting, and I wonder what is special about parenting vs general self-help at this point.

Another question is how America’s obsession with self-improvement (and its reliance on influencers) affects parenting. Do we want our children to follow the self-help theories? If so, we might be projecting our desire onto children, that is, to be self-helping to achieve something, just like older generations were projecting theirs. Then, is it fair to criticize parents in different styles, like Asian Tiger Parents? We are in the same boat in the grand scheme of things.

Your Turn

This is not precisely a parenting book but is written by a popular parenting book author Julie Lythcott-Haims. The book is a set of advice for young adults in their twenties or early thirties. So it’s not really for me, but I enjoyed it regardless.

It talks about what adulthood should look like. The depiction told me how liberal American adults are supposed to live today. The author is very opinionated and I don’t necessarily agree with every point, but at least it gives a baseline and, more importantly, the anchor of what should be discussed. I don’t have that level of consciousness so it helped.

Tomorrow, and Tomorrow, and Tomorrow

I wanted some distraction and picked this from a bestseller list. The one-line summary for this book in that list is:

Two friends find their partnership challenged in the world of video game design.

Combined Print & E-Book Fiction – Best Sellers – Books

The story starts in their college lives and then enters into professional ones. The plot is dynamic and the writing style is very visual. The “video game design” part is relatively shallow but it’s good enough to make the details fancy.

I also enjoyed the depiction of Southern California. There is LA traffic, Beverly Hills, Korea Town, Venice, etc. It is very visual, although maybe a bit too stereotypical. It made me want to revisit there.

The Double-Back Dark Pattern

A while back TikTok Android app introduced a shady trick that requires a user to hit the “back” button (or back gesture) twice to quit the app. It slips an extra page into beneath the current one, even if the user didn’t ask for it.

It would work for sure in terms of engagement or whatever, but I was distressed by the invention of yet another dark pattern.

And recently Facebook app (the blue app) added this trick too. It’s not surprising at all since they’ve been very good at stealing. Still it is disappointing regardless. My fear is that this pattern gets infected with other consumer apps over time.

If I ask to quit, just quit. Please.

Open The Kimono

These days many software projects have replaced “non-inclusive” words like blacklist and master with more “inclusive” words like denylist and main. It was taken as a controversial move (especially outside U.S.) and I also had a mixed feeling. Then there comes a “got it” moment.

Have you heard the phrase “open the kimono“? I had not. It is a business jargon, implying “being transparent” or “opening the book”.

I found this phrase in a “non-inclusive term” list. Indeed, it sounds ridiculous. If you are Japanese, you’ll easily find it racist and sexist. There is no ambiguity. I would rather say “show the dick” or something if I really had to use this phrase. (It is still sexist, but at least not racist.)

Still, a Google search suggests that it is not so obvious to some people in English-speaking counties. It feels bewildering and frustrating to face this ignorance and insensitivity. How can it ever be “it depends”???

Then I realized how ignorant and insensitive I have been to other cultures. I think I have concealed it well enough so I haven’t offended anyone too much, but I can never consider myself as empathetic or considerate either.

In Japan, males are over-represented and females are under-represented. The degree is much more severe than it is in U.S. Non-inclusive Japanese terms from this angle are everywhere, but these are so deeply rooted in Japanese culture that it has been a bit tricky to me, a Japanese male, to feel it.

The abrupt insensitivity of Open The Kimono is, on the other hand, tangible. And it reminds me that we don’t like the world where people are speaking the words that stink.

Escape Room

I had my first Escape Room experience with my teammates today. Although it is a popular team building activity in the workplace, I have dodged it for years. That’s what an introvert does.

It was fun. I was relieved.

The negative sentiment against the escape room grew in me after I had a “virtual” version during the pandemic. It was a painful experience, as many online meetings are. It felt like playing a single player puzzle game, with multiple people, over video call.

Today’s “real” escape room is different. It is designed to require multiple people to solve the puzzles by, say, having multiple buttons to be pushed at the same time. In such a physical design, you can contribute a little even if you are a lesser puzzle solver like me. And doing a physical activity together feels fun anyways.

What are good “virtual” team building activities then? There must be something, but I don’t know. I’m glad I live in an old world and don’t have to worry about that.

I have probably become like one of the old people in the 20th century who enjoyed the annual company trip to a shitty resort hotel. And I accept that datedness.

日本人はアメリカのどこに住んでいるのか

家賃高すぎベイエリアのからの脱出を夢見る現実逃避活動。今回は日系人の多く住んでいる地域(county)を探してみる。日系コミュニティの存在は必ずしも住環境を決める最重要ファクターではない。とはいえ子供の日本語教育とか日本食材の調達、あと英語の不自由な我々が人間関係を構築する上でもまあまあ重要。しかし、たとえば住宅価格などの誰もが気にする要素に比べ世の中に定量的な解説が少ない。仕方ないので 2020 の US Census を眺めてみたい。

Census は API があるので、適当にみつけたサンプルを参考に EDA する。この記事には画像だけを張り付けているが、対話的につつける地図と表も作ったので興味のある人はこのノートブックをどうぞ(ロードには時間がかかります)。

なお以下に張り付けたプロットの大半からは Hawaii と Alaska を省略した。そのへんに引っ越す気はないので。Hawaii めちゃ日系人多いんだけどね。

日系人の多い Counties

LA + Bay Area (+ Seattle) が突出しているせいで他が色褪せ識別できないため、そのへんのメジャーどころを外すべく日系人人口が二万人以下の county に絞って彩色しなおす:

引き続き CA および WA が強いが、それ以外にも:

  • Las Vegas のある Clark County, Nevada, Chicago 近辺の Lake County, Illinois といった 10K counties が頭を出し、
  • 他にも Arizona, Texas, といった CA 近接州、東海岸や五大湖付近にある数千人規模のコミュニティも滲みだしてきた。

要するに CA 付近や大都市には日本人も沢山住んでいる。まあそうですね。ただし東海岸は人口の割に少ない印象。

一旦地図を離れ、 日系人人口 top 50 counties を bar chart にしてみよう. State ごとに色を変えてある。

LA County の突出ぶりがよくわかる。巨大都市。隣接する Orange County もひきづられて二位。SoCal は人がいっぱい住んでいる。

なお参考までに Hawaii を含めた top25 をプロットしてみると、LA すらもぶっちぎる圧倒的存在感がよくわかる。(赤が HI, 橙が CA.) 面積の違いを考えると桁違い。

日系密度の濃い Counties

LA など人口の多い都市では都市自体の規模に比例して日系人人口も増えるだろうから、必ずしも強いコミュニティがあるとは限らないのではないか。そこで総人口に占める日系人の割合 = 日系密度をプロットしてみる:

やや雰囲気が変わり・・・

  • LA 周辺は引き続き強いが、密度ではベイエリア (特に Santa Clara County) が上回っている。Seattle も LA よりわずかに高密度。
  • 内陸部にも細々と色の濃い counties がある。

内陸部にある高密度を眺めてみると、大半は county の人口が少なすぎるためのノイズだった。たとえば Fallon County, Montana は 1% を超える日系人密度を持つことになっているが、そもそも county の人口が 3000 人しかいない。日系人も 30 人。

そんな中 Putnam County, Indiana は 1.5% / 550 人とそこそこの規模がある。検索してみると自動車メーカーが居を構えているらしい。引っ越し先としての適性はさておき興味深い発見だった。

10 万人以上を擁する大きな county だけを残してフィルタしてみると:

あまり面白くない結果となった。つまり、CA と WA など西側が強くて、五大湖周辺と東海岸にもちょっとある、くらい。人口ベースで眺めてわかった以上の発見はない。

結論

  • アメリカの日系人は Hawaii に一番多く住んでいる (15-20 万人)。
  • それ以外では SoCal の LA 周辺 (10-15 万人), NoCal の Bay Area (五万人+)、WA の Seattle 周辺 (三万人)に多く住んでいる。
  • 五大湖周辺、東海岸などの大都市、Arizona, Nevada, Texas などの CA 隣接州にも数千~一万人規模で日本人が住む counties がある。
  • 密度でいうと Hawaii が桁違いで突出しており、それ以外だと Bay Area, Seattle 近辺が高い。LA 周辺も濃いが、人口の突出ぶりほど差はない。

基本的に日系人の多く住むエリアはどこも High CoL である。したがって家賃を下げようと思うなら SoCal/NoCal/Seattle のような日系人の多さは諦め、数千人から一万人規模の日系コミュニティを受け入れるのが現実的に見える。まあそのくらい住んでいれば日系食材店の一軒くらいあるでしょ。日系じゃなくて Asian Groceries でもいいよ。あるいは、日系人が多く QoL の高い county 自体ではなく、その近隣で CoL の下がるオプションがないか探すこともできるかもしれない。

もっというと、他の指標で住みよい medium CoL の地域を探したうえで、こうした日系 geo data は補助的な指標にするくらいがよさそうである。

備考

  • County 境界が適切にコミュニティを切り分けていないケースがある。たとえば Portand, Oregon は都市部を複数の county が分断している。そうした地域は過少カウントされているかもしれない。このように分断されたコミュニティをあぶりだすにはクラスタリングなどの工夫が必要だろう(やってない)。
  • 探索に使った Notebook では日系人だけでなく Asian 全体の人口も集計している。Asian の分布と日系人の分布は概ね一致しているが、全ての Asian 集積区に日系人が多いわけではない。たとえば Santa Clara County は日本人もまあまあ多いが Asian に至ってはおよそ人口の 1/3 を占め圧倒している。Queens County, New York は人口の 1/4 が Asian だが日本人は 0.3% 程度である。逆に日本人が突出して多い地域はあるかというと、Hawaii を別にすると見当たらない。
  • 上のデータはハーフなど日系混血の人口は数えていない。Census data の都合です。ごめんね。

Morning Spinach, April

2023-04-03

  • 07:03. さて妻子が一足先に帰省しているので自分のフライトがある三日後まではヒマ!ガンガンやってくぞ!といいたいところだが空気の抜けた風船みたいに緊張感がなくてこんな時間。しかしまだ一時間半くらいある。単身者時間ありすぎだろ。ヤベーな。
  • 子の風邪で流れてしまった podcast 録音があるので、まず復習から・・・。
  • Podcast の準備は事前にやりすぎると内容を忘れてしまうが手前すぎると準備の時間がなく、あんがいタイミングが難しいのである。
  • カンペを眺め直すだけで一時間くらいサーっと経ってしまう。
  • 残り時間。先月なにやってたっけ・・・・というと RL の教科書をつまみ読みしようとしていた。
  • Sutton & Barto Book: Reinforcement Learning: An Introduction
  • Ch 13.1
  • これノートとらないとわかんないやつじゃん・・・。

2023-04-04

  • 07:24. さて続き・・・じゃなくて podcast 出す準備をしないといけません・・・。
  • 昨日は Adobe podcast で録音してみたが、インターネットの不調で音がズレるという超基本的なバグにぶちあたってしまいもう使わね、という気分。次回からは金払って堅いサービス使います。はい。
  • #111: Formal Algorithms for Transformers – Misreading Chat
  • このエピソード、聞いてもまったくわからなくてすごいな我ながら・・・。というかズレが厳しいな・・・。

2023-04-06

  • 過去2日は最初不在に合わせて友達と管を巻いたり荷造りしたりでろくに論文も読みませんでしたが、いまは空港でヒマなので読んでます。コーラでうっすらとカフェインもキメている。
  • [2010.11929] An Image is Worth 16×16 Words: Transformers for Image Recognition at Scale
  • Multmodal 系論文を読む準備。CLIP にも出てきたね。
  • CNN のようなアーキテクチャ埋め込みの inductive bias がなくても、transformer は見るべき場所を学べるよ、という話。これ論文も読む前にアーキテクチャだけ見てるとバカじゃないのと思っていたが、いざ論文読んでみると完全に理にかなった自然なアプローチに思えてくるね。
  • Classification task で supervised に “pretrain” している。ただ patch を mask して BERT 的に self-surpervised に train しても悪くはないらしい。ふーん。
  • まあ、いい論文でした。ViT 改良版のなんとかいうやつの論文も印刷してくればよかったな。
  • そいえば昨日 BLOOM という paper を冷やかしていて思ったが、100B+ の LLM を train できる組織って世界全体でいくつあるんだろうね。1000 はない気がする。100 はあるかな?費用がわかれば想像しやすいのだが。
  • チャット様二人に聞いたところ、tens of millions らしい。100 はあるな。動機がなさそうだけど。
  • はーもっとたくさん印刷してくればよかつまたな。というな Boox もってくればよかった。一人で乗る飛行機のヒマさを忘れていたぜ。
  • [2212.08073] Constitutional AI: Harmlessness from AI Feedback
  • SL につかうテキストの生成を、LM の校正でつくる。
  • Reward / Preference Model を作るための評価を LM にやらせる。
  • 人間が用意するものは意地悪プロンプトと。従来のような模範解答や一部の採点作業(helpfulness)も、まだ残している。
  • なんか面白いね。Safety はそんなに興味無いけど、LM が LM を採点したり校正したりするのが面白い。Diplomacy model を彷彿とさせる。
  • [2112.09332] WebGPT: Browser-assisted question-answering with human feedback
  • 完全に Bing です。そもそも Bing API 使ってます。
  • めちゃ面白い。状態を prompt に詰めて持ち歩くのが、なるほどという感じ。特に quote.
  • 要約は集めた quote を使って最後にやるのだね。もうハルシネーションとか言ってイチャモンつける時代は終わりました。
  • 検索に限らず、このLMに外界を探索させるアプローチは可能性があるね。すげーわ。WebGPT の具体的な実装が最適解という気はまったくせず、いかにもPOC という風情に無限の可能性を感じる。
  • これを plugin として実装する OpenAI のセンスは評価するけれども、それ以上に plugin を公開前から MS に持っていって投資を引き出した Sam Altoman の神策士ぶりが際立つね。なんとなく Nadella スゲーと思っていたが、冷静に考えると真の黒幕はどう考えても Altoman である。
  • [2203.11147] Teaching language models to support answers with verified quotes
  • ウェブサーチから帰ってきたページを要約させることで、発言に引用をつけられるようになりましたという話。自分がもともと Bing はこういう感じかと想像してたのに近い。WebGPT にくらべると面白みはない。サーチにくっつけるならこんなもんでいい気もするが…。
  • GooherCite は Gopher を単なる building block としてしか見ていないが、WebGPT には GPT に対する信頼というか、AGI-ness を追求する野心があるよなあ。 ビジョンがあるとも言える。
  • はー印刷してきたのぜんぶよんじゃったけどまだ6時間くらいある。なんか難しさの薄い論文ばっかし選んでしまったな…。
  • LLM の Fine-tuning procedure を各社が闇雲に試している 2021,2022 あたりの論文は、ConvNet とかのアーキテクチャが色々模索されていた頃のルネサンス感があるね。ただ training の仕方というのか high-level に書かれているのを読んでも、実際の難しさや再現のために必要な情報が足りているとは全く思えず、そこに物足りなさはある。みんなプレスリリース的。
  • [2106.09685] LoRA: Low-Rank Adaptation of Large Language Models
  • 搭乗直前に駆け込みで電話にダウンロードしておいた。
  • これは面白いな!そして表題に反して LLM 固有ではなかった。画像生成の fine tuning に関するスレで見かけた記憶があるが、そういうことだったのねー。
  • ただクラウド業者が LLM 用の fine tuning option として提供するのはちょっとトリッキーそうでもある。クエリ単位で LoRA の重みを GPU にロードする必要があるし、掛け算も増えるから遅くなるよね。バッチならいいのかもしれないが。
  • まあいいです。MSR いい仕事をした。
  • [2103.14030] Swin Transformer: Hierarchical Vision Transformer using Shifted Windows
  • Swin Transformer.
  • ViT 雑すぎだろ、とブチ切れた CV の人がもう少し入り組んだバージョンを考えた、的な話。
  • 普通の Attention は画像全部みえちゃうけど全部いらないですよね、解像度縮めていけば見えますよね、という、ConvNet 的な induction bias を取り戻そうとする。
  • Unified modeling に使おうなと言うけれど、あまり embedding を圧縮しすぎると NLP と混ぜられないのでは?という気もする。まあ multimodal の論文を読めばわかることでしょう。ダウンロードしとけばよかった…。
  • [2001.08361] Scaling Laws for Neural Language Models
  • LLM はモデルの hyperparameter や training compute からだいたい誤差が予測できるよ、というような話。Sam Altoman がインタビューで言ってたな、というか GPT4 のチラシにもそんなこと書いてあったね。
  • こんな実験のために GPU を燃やせる会社はなかなかなさそうである。人類の叡智、という気もする一方、なんらかの煙幕なのではと懐疑もある。追試できんじゃん。
  • はーこれにて完全に手元の論文がなくなりました。あと4時間もあるのにー!
  • まあ子育て Audible でも聞きます。

2023-04-25

  • 日本から帰って以来家庭内が乱調だったが、ようやく復帰。三週間近く失われてしまった。海外旅行は大変。
  • そして様々な都合により朝には活動できなくなったので、今日からは Night Spinach です。朝の fresh brain を使えないのは残念だが仕方なし。
  • Podcast 公開作業。
  • #112: SkyPilot: An Intercloud Broker for Sky Computing – Misreading Chat
  • cooking video を眺めて休憩。夜は集中力がない・・。
    My Second Favorite Taco from Mexico City – YouTube
  • さて自分のターンの準備をします・・・。
  • 第一稿終了。前日に直して、来週できるかな・・・とおもったが土日キャンプで月曜にはできないな・・・夏の間は隔週でキャンプなので週末終了のお知らせだわ。きびしい・・・。
  • LLM シリーズ、全 4-5 回文くらい話すことあるといえばあるけれど、なんか世の中みんなこの話ばっかりしてて自分が改めて話す必要あるのかな・・・という気分。
  • 別にどの論文も読むのに難しさがなくて、ほんとプレスリリース的なのだよね。メディアの人とかが読んでもわかるので、そういう人たちに読ませておけば良いのではないか。
  • ではどういう話なら面白いかというと、やっぱコードを読むのが良いのだろうなあ。一方で、どこまで時間を溶かすべきかというと悩ましい。CS の若く賢い知能の上澄みが 過去にないレベルでがなんかうまいことやろうと注力していて、しかも人が余りすぎていて、解説にすら優秀な頭脳が割り振られている。ここにはほんとに何もやることがない。
  • LLM とか眺めてないで、なんか他にやることあんじゃないのかね、我ながら。
  • まあ VLM の論文にいくつか積み残し(Flamingo, Palm-e)があるので、それは紹介するかどうかは別として読もうと思います。
  • 11:45. 寝るべし。

2023-04-26

  • 20:09. 68.5kg. 昨日から fast を始めております。目標 65kg. 5月いっぱいでいけるだろうか。
  • 今日は雑用の日です。Sigh.

Plug This Off, Plug That In.

For the last few months, I have reduced my media consumption, mainly from the audio: I was using my running and commuting time listening to podcasts, but paused all subscriptions. The tech stuff these days made me nervous, and I couldn’t resolve that discomfort by myself.

Do I get the peace of mind I wanted after the plug-off? Not really, objectively speaking. There is a Fitbit metric called Zone minutes. When I was listening to podcasts I occasionally had it recorded. I have had none since I paused. It looks like I was distracted by my own thoughts.

So I started wondering if maybe I should start listening to something again.

That’s when my spouse and I had a parent-teacher conference with the kindergarten teacher of my daughter.

In the session, we talked about recommended reading materials related to parenting. The teacher suggested some to us. To my surprise, I already had read half of them. But I also found that all my readings happened more than a few years ago. I haven’t read that kind of book since COVID, and the balls were still on the floor.

Now I got a plan: Tune to recommended parenting books instead of tech commentaries. My literacy stopped at the ones for toddlers but my daughter is going to start at an elementary school this summer. It was long overdue.

I hope they are more actionable than, say, the news telling the employer being threatened by an uprising startup. That actionability, I hope, makes me less nervous. The Fitbit will tell.

Morning Spinach March

2023-03-01

  • 04:45. 昨日の昼間ミーティングで眠気を抑えるべくカフェインを採ったら案の定睡眠が mess されてしまった。
  • ぱぱっと Podcast 用意して出すべし。
  • いちおう一回くらい聞くか・・・。
  • 聞きつつ gdrive の使い方を調べましょう。
  • うごかねー 😦
  • もうめんどくさいのでブラウザからポイっと upload してみるか 50GB のファイル群を・・・。17 時間かかるらしい。クラッシュしませんように。なお上りは 1.5MB/s くらいです。しょんぼり・・・。
  • さて、このボランティア活動はこのへんで wrap up として、次なにやるかな・・・とメモを見直す。

Next Project: LLM 冷やかし活動

  • LLM 流行ってるしおもしろそうなので、教科書的には理解しておきたいなという気分がある。教科書的な理解というと曖昧だけど、学部生的理解とでもいえばいいかな。実践できるスキルや知識ではないが、それが何なのか一定程度わかっている、みたいな。CS 卒業してればボンクラでも仮想記憶とかプロセスとか GC とか一応わかっている、という程度に LLM というか language model というものを理解したい。マルコフ連鎖のごついやつでしょ、とか口走らないようにしたい。
  • 具体的には以下のような疑問に答えたい:
    1. なぜあんなにパラメタがクソでかいのか知りたい。アーキテクチャがわかればこの答えはわかると思うので、つまりアーキテクチャを把握したい。
    2. なぜマルチタスクに出来るのか知りたい。これむかし向井さんが BERT を紹介してくれたときに出てきたけど、よくわかんなかったのだよね。
    3. その他自分の知らない重要なアイデアがあれば、それも知っておきたい。
  • ステップとしては:
    1. 一般人向けにかかれた読み物を何本か読んで、心の準備と重要なアイデアをポップカルチャー的に把握する。願わくば重要な論文とかもリンクされていると期待できるので、そういう reading list も可能ならつくっていく。
    2. Reading list が揃わなかったら、なんらかの新しいサーベイを探す。ML 分野やたら論文あるので、きっとサーベイもあることでしょう。
    3. Reading list のうち重要そうな論文 (GPT-3 とか?) をよむ 。理解はできない。
    4. 理解するのに必要な論文を backtrack しながら読んでいく。
      ここで、いちおうその重要そうな論文は理解できたことにする。

と、ここまでできれば満足であろう。以下はストレッチ項目:

  • 大企業各社の出している LLM 関係の論文をいくつかひやかし、どういう違いがあるのか見てみる。
  • なんらかの実装のコードを読んで見る (nanogpt とか?)
  • 何らかの pre-trained な小さいモデルを持ってきて hello world してみる。

といったところかな。

2023-03-02

  • 04:05. さて本題に入る前に調べものがございますのでそれを軽くやります。
  • さてそれはいいとして一般向けLLM読み物を探しましょう。ちなみに HN search で適当にさがすというひどい探し方をしています。
  • 10 本前後あつまったが全部よむ必要があるとは思えないな。
  • 一本目:
    What Is ChatGPT Doing … and Why Does It Work?—Stephen Wolfram Writings
  • Wolfman Language に GPT-2 が入ってるの面白いな・・・。
  • Token のリストからの選択に乱数性をあらわす “temperature” というパラメタを使う。
  • GPT-2/3 以外の話は全部知ってる話で、肝心な話は具体性が足りなすぎてまったくわからない・・・。重みを二次元の画像として可視化してもなんもわかんないよ!
  • ただ GPT-3 でなく 2 (あるいは 1?) の論文から始めるほうがよさそう、ということはわかった。
  • 途中ですが時間切れ。

2022-03-03

  • 05:10. カフェインをとったわけでもないのに睡眠を mess してしまった。もう時間ないけど、ちょっとだけ読み進めるべし。
  • What Is ChatGPT Doing … and Why Does It Work?—Stephen Wolfram Writings 読了。あまりに philosophical であった。ただカッコだけの言語で train すると何が起こるか、みたいな実験は面白い。こういうのできたらよいね。あと Aligning language models to follow instructions も読むとよさそうなことがわかった。
  • 引き続きポップカルチャー読み物を消化していきます。
  • Large Language Model: world models or surface statistics?
  • なんらかの philosophical discussion だとうと思って読み始めたら、オセロの盤面で GPT を train する(とわりかし間違えずにオセロできるようになる)という話だった。面白いな。こういう用途なら手元で動くようなモデルでも遊べるかもしれない。
  • しかし model に介入するというところはよくわからなかった。まあいいです。

2022-03-04

  • 04:30.
  • How does GPT Obtain its Ability? Tracing Emergent Abilities of Language Models to their Sources
  • 正直この文章がなんなのかよくわかっていないが、HN にあったので。
  • In-context learning, Chain-of-Thought, Reinforcement-with-Human-Feedback など、どこかで聞いた単語が登場するが、なんなのだろうね。
  • コードで train するのがモデルの賢さを高めている、とか書いてあってほんまかいなという気になる (hard evidence はないらしい). 日頃からコードを読んで鍛えている我々プログラマ、普通の人類より賢いのでは!? (programmer supremacism)
  • めちゃ新しい論文がリンクされまくっており、みんながんばってんのね、ということがわかった。OpenAI ストーカーとして圧倒的実力を発揮しており素晴らしい。LLM というものを理解する上でこんなに OpenAI 中心にものを考えるのが良いのかはよくわからないが、ポップカルチャー的には正しい態度とも言える。
  • LLM だけじゃなくて、上に出てきた buzzwords もなんとなく理解したいもんだねーそのうち。
  • A Closer Look at Large Language Models Emergent Abilities
    • ちょっと寄り道して同じ人が書いたブログ(?)をもう一本読んでみる。
    • GSM8K という算数問題データセットがあるらしい。へー。そして OpenAI である。インターナルには 8M くらいもってるのでは。テックカンパニーは問題集の出版社でも買収して問題つくらせればよくね? (such a jerk!) MathQA というのもある。
    • 自分は math では LLM に勝てない気がするが、特に何の悲しみもないな・・・。
    • “prompting” と fine-tuning の違いがわからん。まあ何も論文読んでないので当然である。
    • [2201.11903] Chain-of-Thought Prompting Elicits Reasoning in Large Language Models これがメジャーなやつっぽい模様。Google いい researcher いるんじゃん。しゃちょーさんのご乱心にとばっちりして嫌気が刺さないよう気をつけてな。
    • OpenAI は ChatGPT 以外もそれなりに API-accessible にしていて偉いね。Google など他の大手もそうしないと、こうやって外野に評価してもられないのでは。
    • 先の記事の補足としてちょうどいい感じだった。よき。
    • On Emergent Abilities, Scaling Architectures and Large Language Models — Yi Tay
    • ついでにもういっこリンクされてたやつ。
    • 細かい LLM のアーキテクチャの違いとかでモデルを巨大化したときの “emergence abilities” の性能に差がつくことがあるが、そういうのってモデルはでかいし評価すべきタスクは色々あるしで評価するのが大変。困ったね、というような話。まあががんばってくれや。
    • しかし small model を fine-tune しても large model の “prompting” に勝つ日はこないなら、人類は PyTorch のことは忘れておとなしく OpenAI の API を呼べということだよな。
  • The GPT-3 Architecture, on a Napkin
    ちらっとみると、やはりこんなのよりは論文みとけという雰囲気である。
  • というわけで論文リスト
    Understanding Large Language Models — A Transformative Reading List
  • GPT1 の論文がどれかわかってなかったが、これでわかった。めでたい。そこからだな。ついでに “RLHF” とかの論文もリンクされていてよい。
  • というわけで明日はいよいよ GPT1 です。読んでくぞー。

2023-03-05

  • 05:30. 起きられず
  • Improving language understanding with unsupervised learning
  • 掴みくらいはよんどくべ。
  • GPT = Generative Pre-Traiing か。その上で Discreminative Fine-Tuning をしろということらしい。
  • 肝心の transformer decoder は mountain view の方の論文を読まんとあかんらしい・・・
  • [1801.10198] Generating Wikipedia by Summarizing Long Sequences
  • Matrix を softmax にいれると u の probability が出てくるのがなぜかわからないこの math 力のなさ・・・。
  • チート記事と照らし合わせると自分は u を誤解しているな。これは次の単語の probability ではなく、入力の “decode” 結果なのか。しかしこれがなにを予測しているのかわからん。やっぱその論文よまないとだめだな。
  • 時間切れ。

2023-03-06

  • 04:05. やむにやまれぬ事情から前日午後 7 時にカフェインを摂取したため起きられてますが、昼間が辛い一日になることでしょう.
  • さて一番重要な 3.1 Unsupervised pre-training がわかってませんが、睨んでいてもわからなそうなので一旦論文を最後まで読み、そのあと理解に必要な資料を探すことにしましょう。登場する変数が説明されてないんだからわかんなくても俺のせいじゃねー。
  • さて fine-tune している各種タスクだが、微妙にわかるやつとわからんやつがあるね。Classification と Similarity, Multiple Choice までいいが、Textural Entailment とはなんぞや。そして Question Answering and Commonsense Reasoning もどうすればいいの?
  • Textual Entailment
    Textural Entailment は { Text, Hypothesis } -> {Entailment, Contradiction, Neutral} という問題らしい。
  • Question Answering, Commonsense Reasoning は Multiple Choice で、別に自然言語で回答するわけではなく選択肢を選ぶ。
  • どのタスクも “traversal-style” すなわち入力に特別な構造はなくて delimiter をつあって concat するだけ、かつ LM のあとも linear layer 一個だけ、という素朴な構造。この traversasl style は前例はあるが一般的ではないとしている。ですよねえ。無茶だよな。
  • training data は BookCorpus で、これはもともと smashwords という indie ebook サイトから無料なものをダウンロードしてきたらしい。Copyright は各著作についているが、常識的に考えて再配布できないですよね。しかし huggingface などで普通に配布されており、やべーなこいつら。まあいいです。Move on…
  • 比較されている他のモデルも何らかのデータで pre-train されているのかなあ。ELMO とはされてるんだろうけど。まあ、何らかの形でされているよな多分。
  • Zero-shot learning のスコア。Zero-shot learning ってどうやって可能なのか全然わかっていなかったが、創意工夫なのだね。Sentiment analysis. とか、[本文…, very] と feed して “positive” と “negative” の probability を比較するとかいっている。何でも zero-shot できるわけではなさそう。
  • でも Question Answering も zero-shot できるのか。クラウド業者が LLM as as service を売るときはこういう創意工夫が出来る程度には細部を expose してほしいもんです。OpenAI の API とか眺めればなにかわかるのかもしれない。
  • まあいいです。面白いね。
  • そして懸念である model の謎を解くべくなんかよむべし。
  • ところでふと文献を見ると Attention is All You Need は translation しかやっておらず、LM をつくった BERT は GPT のあとなのだね。競争の激しい分野である。

  • [1801.10198] Generating Wikipedia by Summarizing Long Sequences
  • “Transformer decoder” paper (のはず).
  • 要約をするにあたり元の文から word を extract するのではなく generative にやるぞ、という話らしい。
  • Wikipedia の引用記事とタイトルでぐぐった結果のページから Wikipedia の記事を generate する、というプロジェクトらしい。熱いな。
  • ところで今気づいたが GPT の parameter size のセクションをすっかりスキップしてしまったな。アーキテクチャがわかったら戻って眺めます・・・。
  • それにしても transformer まったく解説されていない!超不親切だな Mountain View の会社・・・。
  • 一方、LM の定式化が書いてあって気づいたが、もしかして GPT の出力にでてきた token の probability のリストは P(w_i|(…,w_{i-1})) 的な各 token の条件付き確立なのかな?それなら全部かければいいということになるが、そうなの?
  • まあいい。Transformer block を理解するには何らかのチートが必要。チートシートさがすべし。
  • 大量のゴミのなか、2,3 個はまともっぽいのが発掘された。ゆるそうな順に読んでいくべし。しかし今日は時間切れです。

2023-03-07

  • 04:07. やってくぞ!
  • [2207.09238] Formal Algorithms for Transformers チートシート論文。
  • “The reader is assumed to be familiar with basic ML terminology and simpler neural network architectures such as MLPs.” MLP くらいならわかる気がするよ!
  • “Despite their popularity, it seems no pseudocode has ever been published for any variant. Contrast this to other fields of computer science” そう思ってたのあたしだけじゃなかった!
  • “Some 100+ page papers contain only a few lines of prose informally describing the model [RBC+21](…) No pseudocode. No equations. No reference to a precise explanation of the model.” そうだそうだ! もっと言ってやれ!
  • 期待が高まるじゃん。
  • Tokenization – 色々あるが “Byte Pair Encoding” が人気。そのうちひやかす。
  • positional embedding / encoding って昔は sin とか謎のハードコードだったけど、今は learn するのだね。
  • “It will be useful to define the softmax function for matrix arguments” そうですよね。
  • GELU ってなに….というと、モダン ReLU なのか:
    [1606.08415] Gaussian Error Linear Units (GELUs)
  • GPT のアーキテクチャわかった。この paper は神。
  • 明日もう一本くらい補足資料を読みたい感じだな。
  • 社内名簿をさがし、著者に「神論文でした!ちょうさんくす!」とメールしておく。

2023-03-08

  • 04:40.
  • さて昨日の Phuong-Hutter 論文を改めて軽く眺めます・・・。
  • Encoder-Decoder, Encoder-only, Decoder-only と三種類もあるのに混乱しかけていたが、冷静に考えるとまあ納得だよな。
  • E-D は翻訳なので、まず原文を encoder した上で、encoded な原文を参照しつつ翻訳を generate (decode) していくわけだ。そして原文は全部みえていいから mask せず、翻訳は先を見たらチートなので mask する。
  • Decoder-only も別に違和感はない。
  • 奇妙なのは Encoder-only で、何が奇妙かというと mask しないので先を見てしまっていることだよな。だから BERT の task は穴あき文を埋めるみたいなヘンな構造をしているのだね。Decoder-only の方が自然な感じがする。だから良いかと言うと、知らんけど。
  • Decoder-only にしても、ちょっと不思議だよね。出力は単語の出現確率のリストで、リストの一番目は一番目の次(つまり二番目)の単語の予測、二番目はの出力は三番目の予測 …. N 番目の出力は N+1 番目の予測となっている。そしてほしいのはこの N 番目の出力だけである。なぜなら一番目の予測である二番目は入力に含まれているのでわかっているからである。
  • にもかかわらず、loss の計算にはN 個目だけでなく全ての出力を使っている。N-1 個までは答えを知っているから(モデルの作りによっては)答えをチートしてしまえるはずで、でも mask で隠してあげているからチートはしていない、という紳士協定(?)によってこの loss が成立している。N だけ使うのじゃダメなのかな?まあ全部使ったほうがお得な感じはするけれども。
  • まあいいです。この論文は印刷したので手元においておくべし。
  • GPT-2 に戻りたいが、その前にこの論文と似たようなブログ記事を冷やかすターン。
  • The Transformer Family Version 2.0 | Lil’Log
  • 自分には advanced すぎる内容だが、attention span を長くするために人々が色々な工夫をしていることがわかった。色々ありすぎるので、GPT-whatever などの自分が読む論文に出てきたアプローチだけを理解するくらいで良いでしょう。

  • Better language models and their implications -> Language Models are Unsupervised Multitask Learners
  • GPT-2!
  • “language provides a flexible way to specify tasks, inputs, and outputs all as a sequence of symbols. For example, a translation training example can be written as the sequence (translate to french, english text, french text).” ずっとこういうビジョンでやってたのだねえ。類似研究もあるらしいし。
  • “To do this we only scraped web pages which have been curated/filtered by humans. Manually filtering a full web scrape would be exceptionally expensive so as a starting point, we scraped all outbound links from Reddit, a social media platform, which received at least 3 karma. This can be thought of as a heuristic indicator for whether other users found the link interesting, educational, or just funny.” Web はゴミばかりなので WebText というクロールデータを集めるにあたっては Reddit を頼りました。ウケる。
  • Tokanization は例の Byte Pair Encoding だが、なんかいじってあるらしい。GPT1 は spacy の実装を使うだけだったので、素朴だったね。
  • “2.3. Model” はちょうあっさりで、GPT1 をすこしいじりました、としか書いてない。いいんだよ絵で書いてくれても・・・。まあいいです。
  • Q-and-A system のデータセットでは 4% 正解。これは相対的には大したこと無いが、たまに答えが返ってくるのはまあ、面白いよな。Hugging Face で試してみたら全然答えてくれないけど、なんらかの conditioning が必要なのだろうか。
  • “the zero-shot performance of GPT-2 is still far from use-able” 四年前はこんなかんじだったのだねえ。
  • LM による Generative vs 従来の ML の Extractive というテーマがあるわけだが、generate するってめちゃ語彙あるよな、という素朴なびっくり感が未だに拭えない。そうした無限の語彙(というのは token レベルじゃなく compound なレベルで) から確率的に言葉を紡ぐのだねえ LM さんたちは・・・。
  • しかし Q&A 含む各種タスクをどうやって GPT2 に feed したのか全然書いてないな。そういう “prompt engineering” のやり方がキモなんじゃないのかね。結果だけ載せてさ・・・。
  • やっぱ学会通した paper でないと単なる企業ブログやプレスリリースとかわらんねえ。しかし大企業の AI 部門が出すこの手のデカデカモデル訓練終了のお知らせは学会通す気ゼロなので、あまり真面目に読んでも仕方ない。
  • 明日は GPT-3 をやる気なく読みます。

2023-03-09

  • 04:50. 朝起きる気合が足りてない。眠くはないのだが・・・
  • さて [2005.14165] Language Models are Few-Shot Learners
  • うげ 75 pages か。長いな。
  • お、in-context learning という言葉をつかっているぞ。GPT-2 みたいなやつのことなのだね。
  • Sparse Transformer というのを使っているらしい。
    [1904.10509] Generating Long Sequences with Sparse Transformers
  • GPT-2 と違い、Common Crawl というデータセットを cleanup して使う。”The Common Crawl corpus contains petabytes of data collected over 12 years of web crawling. “. 10 年以上前からあるのだねえ。これが S3 にしかなくて GCP においてないあたり、GCP の頑張りのなさを感じるよな。Public data はぜんぶミラーしてくれ。なお使ったのは最近の 45TB ぶんで、フィルタしたあとは 500GB. べつに petabytes 使っているわけではない。その 500GB や WebText を公開しないあたり、Open じゃない AI であることよ。
  • あとは例の Reddit からリンクを集めた WebText も引き続き利用。
  • training は “we use a mixture of model parallelism within each matrix multiply and model parallelism across the layers of the network” って行列の掛け算すら単一 GPU に収まらないのか・・・どんだけ・・・。
  • Chapter 3 はひたすらテスト結果の紹介である。モデルサイズによってビューンと伸びるものもあれば、収束してるっぽいものもありますねー、Zero-shot とくらべると Fw-shot はいいですねー、というのの繰り返し。
  • Fire 3.16, 英単語の意味を教えて例文を書かせる。やー GPT 単語帳やりたいなー。それと Anki があれば英単語暗記は solved problem for-free じゃん。
  • Limitations. “samples still sometimes repeat themselves semantically at the document level, start to lose coherence over sufficiently long passages, contradict themselves, and occasionally contain non-sequitur sentences or paragraphs.” 人々が騒ぐ以前に登場時点から既知である。
  • “scaling pure self-supervised prediction is likely to hit limits, and augmentation with a different approach is likely to be necessary.” それがあこのあと出てくる論文たちということなのだろうねえ。というか “Promising future directions in this vein might include learning the objective function from humans [ZSW+19a], fine-tuning with reinforcement learning, or adding additional modalities such as images to provide grounding and a better model of the world” すべて予告されている。
  • “Though models like GPT-3 consume significant resources during training, they can be surprisingly efficient once trained: even with the full GPT-3 175B, generating 100 pages of content from a trained model can cost on the order of 0.4 kW-hr, or only a few cents in energy costs.” よくコストで騒いでるけど、実際は言うほどでもないのかな?
  • とにかくでかくしたら色々できるようになった、という論文だった。アーキテクチャには新しさはないかもしらんが、他社に先駆けサイズをバーンを 10x することでいち早く新しい知見を導いて競合を引き離したのはビジョンがあってイノベーティブと言ってよいのではないだろうか。
  • GPT-2 の論文よりはたくさん context (prompt) の例が載っている。
  • 時間切れにつき今日はここまで。明日は reading list 再整理かな。

2023-03-10

  • 04:20.
  • Figma のリクルータからメールが来た。あのひとたちこのご時世に hiring してんのね。しかし wasm だってさ。なんも知らん。
  • さて GPT-3 のあとに何を読みましょう。
  • 要素技術 (Byte Pair Encoding, Sparse Transformer) を読んでみたい気もするが、細かい話なのであとにすべし。
  • In-context learning はじめ様々な buzzwords についての論文を読んでいきたい気もするが、なにしろ量が多すぎてどこから始めたものやらである。
  • まずは OpenAI の GPT-3 改善論文を探し、一旦 ChatGPT までたどり着くのが良い?
  • チートシート Illustrating Reinforcement Learning from Human Feedback (RLHF) 論文いっぱいあるなー・・・。まずこのチートシート自体をよむか。
  • “Proximal Policy Optimization” (PPO) という RL アルゴリズムがあるらしい。
  • KL-divergence…そのうち読んで表面的に理解してあげるからね… しかしそんなには重要でないっぽく、ある種の regularization factor として使われている。
  • Human feedback は集めると “reward function” を作れるらしいが、まったく自明でないな。
  • Human preference の他に well-written text も必要とされているが、よくわかんないなあ。
  • 勤務先も human feedback を社内で集めていると報道されているが、レイオフ真っ盛りのなかでそんなん知るかよって感じだよな。ほんとちぐはぐだよね。まあいい。
  • LM に対する RL はかなり early phase という感じで、ぜんぜん決定打はない模様。色々読んでバリエーションを理解するのは難しそうなので、OpenAI のやってるやつだけよむことにしょう。ただ RL をまったくわかってない問題があるね。いちおうInstructGPT の論文を読み、そこから参照されている RL 関係の論文をよむ、ということにしておこう。RL はそのうちちゃんと勉強したいと思いつつはや 五 年くらい経ってますねえ・・・これなー・・・。PPO が出てくるなら読んでみるかとおもったが、検索しても載ってる様子なし。
  • しかし!OpenAI がオンラインに RL チュートリアルを書いてくれている!Introduction — Spinning Up documentation これをそのうちチラっと読もうではないか。
  • Aligning language models to follow instructions
  • さて InstructGPT です。また 70 pages くらいある・・・
  • データのラベル付け(詳細はあとで出てくる)、模範解答の執筆、比較採点。ずいぶん色々人間にやらせておる。API から submit された模範解答(を submit できるのか)も使ってるというので、機密データを OpenAI に渡すのは微妙?どのAPIなのだろうな。
  • ”Alignment tax” Instruct すると instruct の対象になっていない NLP task のスコアが下がる。なんらかの小細工で tax を減らせる。
  • OpenAI 自身の prior work: [2009.01325] Learning to summarize from human feedback
  • まず prompt をあつめるのか。これが API に submit されたデータ。出所は playground (もう存在しない) なので、さすがに paid customer のデータは使っていなかった。
  • 採点にせよ模範解答にせよ、このデータセットの質は超重要なのでは・・・。Crowdsource ではなく contractor を使っている。そのうち正社員を雇うようになりそうね。訓練用模範解答書くとか普通のラベル付け以上に心が摩耗しそうだが、Language model を自分色に染められるならアリか?この論文では数万件のデータだけど、たぶんもっとほしいよね。でも upwork とかじゃなくてもうちょっと出所のしれた人間を雇える方が良さそうだが・・・。
  • Labeller に “sensitive topic” への繊細さなどをチェックする採用試験があるらしい!世紀末感あるな。Appendix B を見よ。
  • Labeller, ゲームや映画の staff roll みたいなかんじで about ページとかに名前を載せてあげればやりがい搾取できるかもしれない。
  • Reward Model は小さめ (6B) の LM の最後をちょこっといじってスコアを出すようにした上で train するらしい。なるほど。
  • 一応ざっと眺めたが、この paper は何が新しいのだろうな。
  • 最初の模範解答による supervised fine-tuning は・・・Fine-tuning である。これは昔からやられている。
  • ということは、回答を比較してランクづけし、そこから Reward Model をつくり、それをつかって RL する、というところがあたらしいのだろうね。なんとなくそのランキングのデータがあれば RM+RL を介さず LM を直接 train できそうなものだけれど、そうでないのはなぜなのかな?なんか differentiable にできない側面があるのだろうか。
  • というか、模範解答全体に対するランキング・スコアを、トークン単位での生成結果にフィードバックするというのはどういうかんじなのだろうね。というと、RM も per-token なのだろうな。でもランキングは per-token ではついていないから・・・よくわからんな。
  • ただ模範解答づくりよりは採点作業の方がコストは低そうである。
  • 時間切れ。

2023-03-11

  • 04:13. すこし雑用があるのでそれを先に。
    • さて。これでひととおり ChatGPT まで追いついたと言えるのではないか。次何読もうかな。
    • まず取りこぼしリストがあります。Byte Pair Encoding, Sparse Transformer.
    • 取りこぼしリストの大物に RL / Policy Gradient / PPO がありますが、RL 勉強するのはかなり気合と時間が必要そうなので、このシリーズの中ではやりたくない。
    • 色々なバズワードの把握状況:
    • In-Context Learning. これが何かはわかった。ただ世間は「なぜ In-Context Learning が可能なのか」について色々研究しており、そういうのは一本くらい読んでも良さそうである。
    • Chain-of-Thought. これ一連の論文では登場しなかったけど、よく見かけるのはなんだろうね。
    • Reinforcement Learning with Human Feedback. InstructGPT でだいたい気が済んだ。他の人たちがやってるバリエーションもあるっぽいけど、まそれはいいかな。[2210.11416] Scaling Instruction-Finetuned Language Models くらいは読んで良いかもしれない。
    • Prompting/Prompt Engineering. これは GPT-3 登場直後くらいから流行り始めた単語でそれなりに論文もあるが、なんか意味あるのかね。要するに In-context learning を上手にやる tips みたいな話で、モデルを finetune してしまうのに比べると小手先感があるようにかじるが・・・。まあなんか一本くらい読んで気を済ませて良いかもしれない。
    • Multi-modal modeling. これがきっと next frontier なのだろうねえ。ちょっと cutting edge すぎて腰が引けるので、まずは他のバズワードからだな。
  • といったところですね。他に読んでみたいエリアはあるか、というと他社の LLM の進捗だな。Meta, Google/Deepmind, etc. まあそれも buzzwords 把握後である。
  • というわけで、まずはどうでもよさそうな prompt engineering についてなんか読んでみましょう。山のようにリンク集がありますね・・・。
  • dair-ai/Prompt-Engineering-Guide: Guides, papers, lecture, and resources for prompt engineering この辺をよむか。
  • まあよくまとまっており、論文のリンクもあり、なかなかよいね。
  • Chain-of-Thought は prompting の文脈で登場するものらしい。
  • ChatGPT というセクション、面白いけど、結局 prompt engineering はベースにあるモデルのデザインによってあっさり無効化されがちで儚い分野だよなあ。ピュアな自然言語でなんかやろうとするより、OpenAI が ChatML でマークアップして構造を与えた prompt で finetune / “instruct” した方が圧倒的に効率的で、そういうのにうまく乗っかる方がよっぽど大事じゃない。
  • ところで chatgpt などが会話の文脈を覚えているのが前は不思議だったけれど、API みると自明だね。つまりコンテクストに履歴を詰め込んでいる。API が UI に比べていいところは、失われてほしくないコンテクストを明示的に残しておけるとこだね。
  • 要約システムみたいのを併用するとコンテクストにある程度長い会話を詰め込めそうである。以前はそういう “コンテスト” は謎の embeddding みたいのになるのだろうと想像していたが、ふつうに自然言語として要約コンテクストを作る時代の方が先に来そうだな・・・。
  • まあ ChatGPT はいいとして、リンクされている興味深そうな論文:
  • [2201.11903] Chain-of-Thought Prompting Elicits Reasoning in Large Language Models Chain-of-Thougt 論文
  • [2101.00190] Prefix-Tuning: Optimizing Continuous Prompts for Generation
  • [2104.08691] The Power of Scale for Parameter-Efficient Prompt Tuning
  • CoT はあとにとっといて、まずもうちょっとしょうもなさそうなやつをよむか。
  • [2101.00190] Prefix-Tuning: Optimizing Continuous Prompts for Generation
  • おもったより面白い話だった。LLM を finetune すると重みがでかくて保存コストなどがかかるので、finetune するパラメタをモデルの外に持つ、という line の研究で、これはなんと入力の sequence の冒頭に “prefix” という形で trainable な embedding をつけるのである!In-context learning で prompt を工夫する、というのを finetune としてやる。よさそうじゃん。
  • ただしモデルにアクセスできないとこういう小細工はできないので、OpenAI のひとが GPT API にこういう fine-tune を口を用意してくれる必要がある。
  • というか OpenAI の API は finetune の口があったはずだけど、どうやってるんだろうね。ChatGPT のモデルは finetune できないけど GPT3 はできたはずで、このレイヤにあるどのくらいのパラメタを unfreeze してくれてたのだろうな。
  • いずれにせよやはり純粋な prompt-engineering はしょぼい、という印象を強調する論文であった。
  • [2104.08691] The Power of Scale for Parameter-Efficient Prompt Tuning
  • “Our method can be seen as a simplification of the recently proposed “prefix tuning” of Li and Liang (2021)” あ、そうなの。
  • ここでもやはり LLM ではモデルまるごとを finetune するのが普通と言っており、そんな気もするけれど、しかしそれはやはり GPT-3 が API ごしに finetune できるという事実と相反する気がするのだが・・・。まああいつらはなんらかの unpublished way で space saving やってるのだろうね。ChatGPT model を finetune させてくれないのはちょっと不思議だけど、単に忙しいとかそいう大したことない理由なのでしょう。
  • 論文つづき・・・をよむには時間切れ。

2023-03-13

  • 04:17. 昨日は夏時間時差ボケでダウン。今日も眠いがやってくぞ。
  • karino2 が bing を褒めており、改めて Bing や Neeva について考える。こいつらは (Neeva では当たり前だが) ChatGPT ではないよな。そのモデルを使ってはいるだろうが。Neeva AI が出てきたときは引用が表示されて ChatGPT との違いにびっくりした (ChatGPT のような “AI / Language Model” は引用はできないと人々は言っていたので) けれど、サーチエンジンと組み合わせればまあ、できても不思議はないよね。そしていくつか論文をよんでわかったのは「要約」というのは LLM というか NLP ではよく研究された分野なのだった。Decoder Transformer にしろ RLHF にしろもとの論文は要約が題材なわけじゃん. Decoder transformer なんて引用とタイトルからWikipedia 本文を生成するという研究で、ある意味 search bot そのものである。とはいえこういうのはリサーチの話で、Bing はそれを製品まで持っていったのが偉かった 。報道からうける印象とちがい、単に ChatGPT 別のガワをかぶせたものではない。Neeva は先行したのはよかったが、ベースにある LM がへぼかったのかなんなのか、力不足で惜しかった。ただ Bing が API の値段を 10x したのは、Bing API と OpenAI API があれば Bing bot はわりかし実現可能だとわかっているからじゃないかな。Google も Bard なてやってないでサーチ頑張るべし。
  • といった与太話はさておき、続きを読んでまいりましょう。
  • んーむ自分の読解力では一本前の “Prefix tuning” とこの “Prompt tuning” の違いはわからないな。まあメインのモデルをいじらず入力につっこむシーケンスの一部分を learn するアプローチがなら cost effective に LM の finetuning が可能、というくらいまで理解できれたのでいいです。はい。
  • こういうのは OpenAI のような hosted model なら彼らが対応してくれればできるししてくれなければ終了だが、相対的に小さいモデルを手元で動かす場合は自分で実装できないといけないので引き続き AI 人材スキルは引き続き重宝されそうである。遊びではそもそも finetune 用の training data が揃えられないので few shots / in-context でがんばるしかない。
  • つぎ。
  • [2201.11903] Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Chain-of-Thought! Buzzword イエーイ!
  • GMS8K, 何問か自力で解いてみる必要があるな・・・ openai/grade-school-math
  • Chain-of-Thought を annotate する人によってスコアが違う。当たり前だが面白い。そして Google Brain で働くエーアイ人材くらいの知性がないと良い chain-of-thought がかけないのだとしたら・・・?エーアイ人材はともかく塾講師が副業で chain-of-thought を提供する時代は近いな。
  • 「自然言語で思考過程を書くと AI が本気だす」というアイデアのわかりやすさ(+素人にも真似できそうな感じ) と GMS8K で SOTA というインパクトの組み合わせが buzzword worthy な論文であった。
  • 次は CoT を learn して finetune … みたいな話がでてくるのでしょう・・・。
  • Prompt-Engineering-Guide/papers.mdx at main · dair-ai/Prompt-Engineering-Guide · GitHub しかしこのページにある “prompt engineering” 論文の量産ぶり、おまえらちょっと落ち着け・・・というかんじである。あまり深入りしないでおきたい所存。
  • 若干おなかいっぱいなので reading list を整理してよむもの考えましょう・・・。今日はここまで。

2023-03-14

  • 04:58. 寝坊.
  • In-Context Learning 与太話ちょっとよむか・・・
  • “Emergent Behavior” あるいみ buzzword だな…
  • How does in-context learning work? A framework for understanding the differences from traditional supervised learning | SAIL Blog
  • Prompt は Bayesian 的に解釈できるなぜなら language model というのは条件的確率だからである… みたいなことを様々な実権などから主張している… のだろうか… むずかしい。
  • Solving a machine-learning mystery | MIT News | Massachusetts Institute of Technology
  • LLM の中には linear model が隠れているよ・・・とは・・・。
  • [2211.15661] What learning algorithm is in-context learning? Investigations with linear models
  • 記事から参照されている論文。めちゃ math である。LM のレイヤ一つが計算の 1 演算を代替できると主張している。そうかい・・・。GPT-3 は 100 レイヤくらいなので、そのくらいのステップは進められるということだろうか。
  • [2212.10559v2] Why Can GPT Learn In-Context? Language Models Secretly Perform Gradient Descent as Meta-Optimizers
  • 似たような趣旨の論文 from MSR.
  • “As shown in the above equations, the attention to the demonstration tokens is equivalent to parameter”
  • やはり式を追う気力 (math 力) がないが、Attn(V,K,q) が update の step になっている、という主張に読める。なんか self attention だといまいちそうじゃない?一般に、こういう in-context learning に強くするアーキテクチャ上の選択というのはありそうだよな。パラメタ数をでかくするだかけではなくて。一方、そういう ICL に強いアーキテクチャが一般的に良い LM なのかというと・・・まったくわからないね。そいうアーキテクチャの自明でなさを指摘した論文をどこかで読んだ気がするが、どれだったかな・・・。
  • とおもってインターネットを探していたら・・・
  • Jason Wei | LinkedIn CoT はじめ重要論文を書きまくっていた Google Brain のスターが OpenAI にとられちゃってますねー。あーあ。まあ選べる身分ならレイオフするような会社では働きたくないよなあ。しゃっちょーさん、いくら節約したか知らないけど星が散っていくのが見えてるかい。
  • まあいいです。これにて CoT のひやかしを終了いたします。
  • [2212.06713v1] Structured Prompting: Scaling In-Context Learning to 1,000 Examples これが残っていたので abstract だけ眺めるが・・・ prompt に 1000 example をつっこむためにすごいアーキテクチャにしてみたよ、という話であった。いや 1000 もあるなら finetune すればいいのでは・・・という気になったところで終了。
  • リストが完全にはけました。これにて CoT のひやかしを終了いたします。
  • 本日はここまで。

2023-03-14

  • 04:23.
  • さて GPT-4 が発表されたので technical report を冷やかしましたが、びっくりするほど何も書いてないねー・・・。GPT 論文シリーズここに極まれりという感。ただ aurhorship のセクションが社員の名前全部書いてるんじゃないかという勢いで、総力戦なのはよくわかる。そりゃ企業秘密は話したくないでしょうな。リサーチャーも下手に論文書くより GPT-x やってましたという方が箔が付く勢いだろうし。
  • context length が 32k! に伸びたのと multimodal なのが表から見える範囲の特徴なので、とりあえず multimodal の論文を読んでいきましょう。ぱっと調べた範囲だと Google の PaLM-E, Deepmind Gato, Microsoft Kosmos-1 というのが目についたので、Kosmos-1 を読んでくぞ。なおそのほか Visual ChatGPT というのもあった。
  • [2302.14045] Language Is Not All You Need: Aligning Perception with Language Models
  • MetaLM という自社内前例があるのか・・・。
  • ChatML みたいにマークアップするのだね。<image> とかなんとも・・・。
  • 画像は “Vision Encoder” と “Resampler” を使って embedding にするそうです。積読スタック伸びてくぞ・・・。
  • Base-model は Magneto という MS GPT みたいなものらしい。各社持ってるわけだねオレオレ LLM を…
  • “Intealeaved data” すなわち画像を埋め込んだ HTML のテキストみたいので learn するというのは・・・なんかタグのまわりのテキストを画像検索に使おうみたいな話だよな。
  • training ではなぜか github/archive/so を外している。なぜ?こういうテキストでテストをしたいからかな?リサーチ論文というかんじである。商用化するなら全部突っ込むわけだが、MS products は OpenAI を使っているので今の所はアカデミックな態度を取れるのだった。読者としてはめでたい。
  • Image Representation は CLIP を使うと書いてあるが、それは “Vision Encoder” とかとは違うのかな・・・?画像周りの知識がゼロすぎる。
  • “The total number of parameters of KOSMOS-1 is about 1.6B.” デカデカモデルを作るという話ではないのだねこの論文は。
  • InstructGPT 以来 “instruction dataset” というのが色々揃っているらしく、Flanv2Unnatural Instruction といった公開データセットを使っている。ふーん。
  • “Image captioning” を評価している。考えてみるとこれって stable diffusion とかがやってることの逆だね。そして captioning の ML はけっこう前からあった気がするけれど、そういうのはどういう仕組みだったのかねえ。
  • OCR-free text recognition とかヤバイな・・・。ただし正答率は 67% か。言われてみればグリフの画像と読み方を対で入れれば読めるようになりそうですね・・・そういうデータセットに言及があったかな?。
  • Chain-of-Thought の例は見るたびに「単なるカンニングなのでは・・・」と思ってしまうな・・・。
  • わりかし面白かったです。デカデカモデルの話ではなく、Multimodal に絞っているのが良かった。1.6B でこれか、みたいな。
  • [2206.06336] Language Models are General-Purpose Interfaces
  • つぎは MetaML という元ネタ論文ね。
  • が、これはなんか無駄に複雑な割に知りたいことは特に書いてない。自分に必要なのは vision encoder と resampler らしい。しかし参照がよくわからん・・・
  • 一つ前の論文では “vision encoder” といい、この論文では “vision language encoder” と呼んでいる・・・。なんなのそれは・・・。
  • [2111.02358] VLMo: Unified Vision-Language Pre-Training with Mixture-of-Modality-Experts これかな? Big Tech は各社フルスタック(?)でぜーんぶ持ってますね。
  • OpenAI の論文引用されてるな。GPT-4 ファンクラブ的にはこっちをよむ方がいいのかもしれないね。まああとで。[2103.00020] Learning Transferable Visual Models From Natural Language Supervision
  • Related work. なんか決定的なアプローチのない分野っぽいね・・・ Computer Vision と Vision Language tasks が別々に議論されているが、どうちがうんですか・・・?後者がキャプションとかなのかな?しかしそれは前者の superset ではないの?
  • そして MS の LM Model Zoo Github をみると VLMo よりあたらしいやつあるっぽいじゃん。そっちのほうがいいんじゃね?というわけでこの論文はここまで。
  • MS stack は馴染みがなさすぎるので OpenAI の論文を見てみたほうが良い気もする・・・でも CLIP というのしかないね。2年前だけどこれ読めば良いのかな。そのあと PalM-E も冷やかしてあげよう。
  • 今日はここまで。

2023-03-17

2023-03-18

  • 04:15
  • さて今日は・・・税金やんぞ!
  • てか 2/22 にきてんじゃねーか書類!!!TT に騙されたクソったれ・・・めちゃ出遅れてしまった・・・。
  • 久しぶりにさわる Colab が納税用 1099 の CSV 化とか、もうね・・・。
  • この Notebook でやるのもう何年目かわからんけど、今年は PDF のフォーマットに変化がなかったらしく一発で動いてめでたい。なぜ TT はやってくれないのか・・・。まあいいです。
  • 納税終了。TT のせいで大幅に出遅れてしまい不覚。TT への hate は年々高まるばかりですが、通勤に使うバスが同じになるくらい近所なので憎みきれないのだった。テック企業はどこもある面ではろくでもない。仕方ない。
  • ついでに免許の更新もオンラインでできるっぽいのでやってしまうべし。
  • 済。一瞬でしたね。こんな一瞬なら勝手に更新して送ってくれやと言う感じだが。
  • It’s Time to Get Back to Work – Spinach Forest
  • GPT-4 paper が期待したものでなかった悲しみを綴るものなり。まあいいですよ。しゃーねえので PALM-E でも読みますわ後日・・・。
  • そういえば英語でブログ書くのだいぶ何でもなくなってきたな。もともと何でもなかった疑惑はあるとはいえ・・・。Design doc ぽくドライかつクリアに書くという当初の目標は失われているが、まあ、いいです。

2023-03-20

  • 04:09. さて…
  • CLIP: Connecting text and images 2021
  • “Contrastive Language–Image Pre-training”
  • ConVIRT というモデルを simplified したと言っている。
  • データセットはインターネットから持ってくる。WebImageText. これが高品質でデカイのが重要。
  • Contrastive objective ってなんだい・・・
  • N 個の画像xテキスト pair を用意し、NxN 通りの組み合わせについてそれらしさを predict させる。そして正解である N 個を除く NxN – N 個の確率を最小化する。なるほど。比較対照するから contrastive なのだね。
  • これはラベルやテキストをズバっと当てさせるより簡単なぶんトレーニングが efficient なのだという。へえ。
  • “InfoNCE loss というのをつかう: Contrastive Representation Learning | Lil’Log, Edit Post ‹ Spinach Forest — WordPress.com
  • Text と image は embedding を consine similarity にするだけというから、これらの encoder を learn させるのだねえ。
  • “image_encoder – ResNet or Vision Transformer” というわけで Vision Transformer がでてきたぞ!
  • “The text sequence is bracketed with [SOS] and [EOS] tokens and the activations of the highest layer of the transformer at the [EOS] token are treated as the feature representation of the text which is layer normalized and then linearly projected into the multi-modal embedding space.” image と text の embedding なんて全然次元が合わないな・・・とおもっていたが、こうやって調整すうるのだね。
  • “we found CLIP’s performance to be less sensitive to the capacity of the text encoder.” このタスクだとデカデカモデルは要らないのか。
  • ResNet と ViT を両方ためしているが、”For the ViT-L/14 we also pre-train at a higher 336 pixel resolution for one additional epoch to boost performance similar to FixRes (Touvron et al., 2019). We denote this model as ViT-L/14@336px. Unless otherwise specified, all results reported in this paper as “CLIP” use this model which we found to perform best.” ということで ViT のほうが良かったのだね。
  • Zero-shot. class をtext として encode し、画像も encode し、cosine similarity をとっていちばんデカイのを選ぶ。まあこれはいいよな。
  • Text encoder, ラベルの曖昧さが問題になる (重機の crane vs. 鶴の crane, 犬の boxer vs. 格闘技の boxer). あとはただのラベルより “a photo of a {label}” と書いたほうがちょっと性能がでる。といった “prompt engineering” が必要。へー。
  • 面白いことは面白かったが GPT でいうと GPT-1 くらいの世代なイメージ。Zero-shot の性能も特別は良くない(ので色々と比較に苦しんでいる雰囲気がある。)ここから multimodal language model までは果てしなく遠いよなあ。2年間の間に何があったのだろうね。
  • はさておき、次は vision transformer でも読んでおくか。みんな使ってそうだから。
  • [2010.11929] An Image is Worth 16×16 Words: Transformers for Image Recognition at Scale
  • ねむい・・・

2023-03-21

  • 04:35. 4 時に起きると眠いというか、眠りの質が悪いな。晩飯を減らし、かつメラトニンでもキメるべきか。
  • さて podcast 採ったので出さなければ。
  • Reddit いじってるうちに時間を溶かしてしまった・・・。
  • Canva は間を開けると free trial を retry できるのか。いいんですかねそれは・・・。Canva は便利すぎるのでこの手のバナーやロゴを作るときだけ金払ってもいいなと思っているのだった。
  • 走りに行こうと思ったら、雨。筋トレでもしようかな。雨天に際し、屋内で早朝に脳内麻薬を出す方法は Supernatural 以来発明できていない。

2023-03-22

  • 05:01. Kindergarden の tech support をしていたらこんな時間になってしまったぜ・・・
  • A Story Writer – Spinach Forest
  • 金払って遊んでみた記。なんというか、CoT じゃないけど prompt 工夫しつつストーリー書かせるとか職業の危機みないた話はおいといて遊びとしてふつうに面白いよな。
  • 一方の Google は “You are invited to try Bard” とかいうスパムを送ってきて、見てみれば waitlist である。おまえら GPU だか TPU だか足りてんのか。Azure で借りてきたらどうですか。
  • さて Podcast 自分のターンの準備でもしますかね・・・。

2023-03-23

  • 04:28. Ubuntu の溜まった update を入れていたらこんな時間。
  • 引き続き podcast 準備。

2023-03-24

  • 05:06. メラトニンを飲んでみたら眠りが深くなり、寝過ごし。ただこれは総体ではよい気がするので今日ものむべし。
  • Podcast 準備。
  • ChatGPT plugins おや。Bing 的な外部資源要約の vertical version. いよいよ検索エンジンやばくなってきたな。そして WebGPT がこれの論文なのだね。あとでよむべし。
  • 準備ほぼ了。いつも後半にいくにつれて滑舌が悪くなっていくので、途中に「ゆっくりはっきりしゃべるべし」とリマインダーの行を挟んでみる試み。

2023-03-29

  • 04:55. 週末から子が風邪を引くなどで大人は捗らず。むしろよくぞ今まで dodge してきた、という感はあるけど。
  • そしてメラトニンはダメだな。眠くなりすぎる。朝起きられない。寝不足の眠さとは違うので慣れれば起きられるかなとおもったが、ぜんぜんダメ。
  • さて Podcast の準備をしていてやはり RL の付け焼き刃が必要だと思い立ったので・・・どうしようね。OpenAI のチュートリアルでもよむか。
  • Part 1: Key Concepts in RL — Spinning Up documentation
  • とばしすぎでよくわからんが、付け焼き刃とはそういうものです・・・・
  • Part 2: Kinds of RL Algorithms — Spinning Up documentation
  • わからん・・・。
  • Part 3: Intro to Policy Optimization — Spinning Up documentation
  • 引き続きまったくわからないが、結局 backprob で gradient を計算する、ということはわかった。では何が supervised learning と違うのかというと・・・正解はないが loss (に相当するもの) は reward を介して存在する、ということなのかな。
  • そして ML model との組み合わせ “Deep RL” という点では概ねこの model-free, policy optimization を気にしておけば良さそうである。
  • まだ全然わかっていないが、それでも以前よりは解像度が上がったので良しとします。はい。
  • Lil’Log ところでこの超便利ブログのひとは OpenAI なのだね。
  • Key Papers in Deep RL — Spinning Up documentation
  • 無謀になんか一本くらい読んでみるか・・・
  • [1602.01783] Asynchronous Methods for Deep Reinforcement Learning
  • ランダムすぎました・・・
  • Sutton & Barto Book: Reinforcement Learning: An Introduction
  • Chapter 13 Policy Gradient Methods に突撃してみるターン
  • 時間切れ。

2023-03-31

  • 子の風邪から身を守るべ睡眠を優先していたら三月が終わってしまった。やれやれ。父のためにもはやくよくなっとくれ。続きは来月。
  • 月初の計画よりは思ったより先に来ている気もするが、GPT-4 によって読むものは色々増えてしまったので引き続き読んでいきます。

A Story Writer

(Caution: This is yet another ChatGPT-4 experience report that everyone has been writing these days. If you don’t like those, you’d better stop reading.)

My spouse had an idea: When we travel by airplane, it might be a good idea to record our reading-aloud of children’s books. Although some audiobooks are available, the selection of Japanese child books is limited in the audio market. And we read these books every night anyway, so why not record them?

Inspired by that, I got another idea: Maybe we can generate some personalized stories for my daughter using ChatGPT and read it to her. My father once wrote one for me when I was a kid of, and I remember loved it.

Even better, I can possibly make a podcast based on these “AI stories”. (What a stupid dad – you might think, and you’re probably right.)

So I signed up for ChatGPT Plus, enabled GPT-4, and gave it a try.

It was fascinating and disappointing at the same time: It does generate some short stories. What it spits out might be too short with a vanilla prompt, but you can tell it to generate “chapter N” to split it up.

Besides the length, I have encountered a few other problems:

The first problem is that it stutters: It stops generating the text in the midst of a sentence. It feels like a bug. I hope they implement some backtracking to keep it moving.

The second problem – although I’m not sure if I should call it a problem – is the boredom of the story: What it writes is extremely stereotypical and boring. It is, however, probably by design. The role of the language model is to generate “most likely text”, and that basically means being stereotypical and boring. In theory, OpenAI can “align” the model towards interestingness. But I’m not sure that’s the direction they would like. (This is not about the “temperature” – the disturbance of the generated text. I don’t think tuning the result less statistically likely makes the text more interesting. It would just make it more unintelligible.)

There is an escape hatch: You can mitigate the problem by explicitly directing the plot: Reject the boring part and ask for a retake. Give some clues on where you’d like to go.

Also, you can maybe ask for options for the plot first, then pick one of them to proceed. This “breast-first search” is something I’d like to try on the next iteration.

The third problem is more serious and for now a deal breaker to me: Its writing style is so cheap!

It’s known that you can ask for the writing style of famous writers, like Haruki Murakami, if the author is famous enough that the crawler has a good amount of data to mimic. But our (Me and Yuko’s) favorite writer of children’s books, Miyoko Matsutani, doesn’t reach that threshold. GPT-4 knows something about Matsutani and it tweaks the style a bit, but it’s far from satisfying. After all, I’m very picky about Japanese writing style and probably don’t care for “Internet Japanese” that GPT is based. I long for more boldness, beauty and authenticity. (What an old grumpy guy – you might think, and you’re probably right.)

The situation will change once OpenAI opens up the fine-tuning capability of their new models, and once it does, I’ll spend days and nights typing in Matutani’s work for training… well, maybe scanning all the books to OCR or cracking the ebooks to scrape, or whatever.


One thing I haven’t explored is the longer prompts: GPT-4 is known to be capable of ingesting much longer prompts than its older versions. My current prompts are a few hundred characters or less. It should go up to like a few thousand. (I’m not sure how byte pair encoding ingests Japanese text. My conservative guess is about one Japanese character per token.)

What should I ask to align the output to the Matsutani style? Is it even possible given her work isn’t in the model’s memory? Should I give some snippets as an example? I have no idea. It clearly needs more experiments and creativity.

Another possibility is to accept the “Internet Japanese” and the absurdity of the generated story, and push the model to the limit to see how crazy it can go. I’d never read it to my daughter, but it can be a great podcast episode. Maybe someone has already done that, but a few more is probably fine.

Despite the technical limitations, I consider my own creativity and taste as the largest limiting factors – How can I push the model hard? How can I judge the “interesting-ness” of the story? How to give it the right direction? It’s a creative challenge that might be worth pursuing.

That said, I’m not sure if it’s my kind of challenge. I should probably read more existing stories to my daughter using that time and energy: The stories are abundant out there, and the time with the little mine is a bit more scarse.


(For the record, here is my first attempt as a GPT-powered story writer. I’ll report back if I get better.)

It’s Time to Get Back to Work

Given both the competitive landscape and the safety implications of large-scale models like GPT-4, this report contains no further details about the architecture (including model size), hardware, training compute, dataset construction, training method, or similar.

gpt-4.pdf

“GPT-4 is not easy to develop. It took pretty much all of OpenAI working together for a very long time to produce this thing. And there are many many companies who want to do the same thing, so from a competitive side, you can see this as a maturation of the field.”

OpenAI co-founder on company’s past approach to openly sharing research: ‘We were wrong’ – The Verge

It dawned on me that they officially ended the era of AI as a research, and switched gears towards AI as a product. For many startups, AI has been a product, not a research, and OpenAI is one such startup, but they have pretended to be a research lab of a big tech company or an elite university. Although there have been signs of this shift, like not releasing the GPT-3 model to the public, they still kept publishing research papers and people loved it. Until now.

Another iconic line from the GPT-4 “technical report” is the Authorship section (p.15) – It looks a lot like a staff roll of a movie, and it asks: Please cite this work as “OpenAI (2023)”. This would never happen if it were a research paper. This signifies that GPT-4 is a product and the whole company has worked towards building it.

What does this mean? When their researchers have done the research-y stuff, it’ll be folded into the next version of GPT and won’t become a standalone research. No published paper that is.

And I think it is already happening. Look at the paper about the Vision-Language model CLIP. This is their early iteration of visual understanding and you can consider it a building block of multimodal models like GPT-4.

This paper is two years old. If they kept doing the “research”, they should’ve been another paper for its successor. That didn’t happen. There is no CLIP-2; they have built the progress into GPT-4 instead. This is how product development works: The innovations occur inside the product. (Compare this to MSR which has up to three generations of VLP models!)

After all, there are no papers about, say, Google’s ranking algorithms (forget Page Rank), Facebook’s feed scoring, Amazon’s logistics, or Apple’s CPUs. These are all the marvels of computer science achieved by smart Ph.D. people, but all have occurred in the products. Few papers (if not none) were written. GPT has morphed into one of these monumental products.

Am I disappointed? Definitely. Do I complain? Not really. Academic research has its limitation. Sometimes innovation needs a product. It needs a user. It requires real problems. It demands money to earn. That’s why tech companies hire Ph.D. and let them write production code instead of academic papers.

The downside is that it mostly happens behind doors. This darkness however is worth it, at least for the innovating engineers and researchers themselves.

However, for us begging paper readers – It feels like the end of a great season. It’s time to get back to work.

I still hold a hope: Someday, once this war is over and the victory makes the GPT gangs rich, one of them goes back to school, write a textbook about AI, in which there is a chapter called “History”, and they share their retrospective as an insider: What they did right. What their peers overlooked. What the vision was. To what extent it is achieved, and don’t forget some technical details. It’d be a fascinating read.

Until that book arrives, I’ll keep reading. Well, I should get back to work. But after business hours, I’ll keep reading.

McDonald’s Theory Of Bug Fix

I like Jon Bell’s McDonald’s Theory and have put it to use from time to time. Last Monday was one such day.

My boss gave me a random bug. I debugged it and figured out what was wrong, but I was still unsure how to fix it. The code seemed to have some layering violations, but the right way to distribute the responsibility between the layers was unclear.

Looking at the commit history, the person who can fix this became apparent. I was wondering if I should just reassign the bugs to them, but that kind of action has had mixed results: People tend to push back, dodge or ignore. No one wants to waste their time on bug fixes.

Then, the idea of McDonald’s Theory came to my mind: Instead of reassignment, I “fixed” it anyway, and sent the PR to that person. To my own credit, I didn’t make a McChicken fix. I tried my best, and I’d consider it more like a McCrispy.

Yet, I know they will push it back. They indeed did. It was still a cheap McDonald’s fix. And it worked as McDonald’s: They thoroughly explained how wrong my “fix” was in the PR comment. So I appraised their analysis, pointed out they are much better positioned to fix it then asked to take it over.

As the theory goes, they agreed. And they gave me their version of the fix after a couple of days. It was better for sure: Instead of piling crap like mine, they removed the code in question. The layering violation seemed to be a leftover from some past refactoring, and the smelly code was not necessary after all. My faith in the theory has elevated.

I should acknowledge my luck that I hit the good engineer. The pattern I had seen was either 1) People just took the crap or 2) People pushed back but did nothing. Neither happened. They did what was supposed to be done, and I appreciate this healthy ending. People shouldn’t eat McDonald’s every day, and they need the ability to cook a good meal.

Morning Spinach: February

2023-02-15

2023-02-17

  • きのうは寝坊してできなかったが、Podcast 準備です。

2023-02-18

  • 飛行機の搭乗に間に合わない、という悪夢で目が覚め疲労困憊。05:15.
  • Podcast 準備つづき。

2023-02-20

  • ハイクの疲労で起きたら五時。
  • 引き続き podcast 準備。
  • 終了。しかし収録は来週。
  • 次なにやろうかなー・・・という前に、税金をやらねばならぬ・・・。
  • 税金。終わらすぞと思うも自社株向け証券会社のやつが来ていない。しかも来月中旬まで来ないらしい。相変わらず suck である。こいつの入力が一番大変なのに・・・。大変な理由は売れる分をこまめに全部売る設定にしているからで、これをやめえばラクになるし過去十年はこれをやめた方が圧倒的に儲かったが、もうそういう時代は終わりました・・・というか自社株保持とか怖くてできません。やれやれ。まあいいです。3/14 までは no actionable items なのでなんか他のことに時間使います。

2023-02-21

  • 04:35
  • 考え事でもするか・・・と思ったが、その前に溜まっっている Todoist で消化できるものがないか見るべし。

2023-02-22

  • 04:22
  • 引き続き考え事

2023-02-23

  • 04:38. 財布をなくす悪夢

2023-02-24

  • 雨ですねえ。
  • Accepting The Funny Mediocrity – Spinach Forest
  • やりたいことを書き出してみたが、まず子の Kindergarden のサイトを crawl して写真を集めるのが最初だな、と思い至った。なぜならサ終に伴いあと一ヶ月くらいでサイトが閉鎖してしまうからです。ひどい。
  • Python (Playwright) でやるか JS (Puppeteer) でやるか。Python の方が慣れてるが、Puppeteer の方が headless としては出来が良さそうなので悩ましい。良い機会だから JS/TS に入門しとくかなー。

2023-02-25

$ npm install --save-dev @types/puppeteer
npm WARN deprecated @types/puppeteer@7.0.4: This is a stub types definition. puppeteer provides its own type definitions, so you do not need this installed
  • 世の中は進歩しているぞ!
  • では Shutterfly のサイトにログインしてみましょう。
  • この XPath 叩ける $x ってなに?どこから来てるの?とおもったら “Console utility function” なのか。べんりじゃん・・・。
  • こういう便利機能もさー、たくさん devrel 雇ってるからこそ生まれるんだよわかってるかい社長さん・・・とか不景気なことを考え出すと幸福感が薄れるのでやめるべし。
  • 時間切れ。

2023-02-26

  • 04:30
  • つづき。
  • TypeScript なしに async/await なコードを書ける気がしない。Vanilla JS ヤベーな。がんばって TS にしておいてよかった・・・。
  • サイトの出来が悪いのか page load 終了を安定して検出できないためしょーもない workaround を沢山いれて乗り切るが、本質的にそういう仕事です・・・。
  • なにかとよくわからないページ遷移が発生するせいで Puppeteer の JS が死ぬので、かなり checkpointing を真面目にやって途中で死んでも継続できるようがんばらないといけない。時間切れ。
  • 昼。妻子外出中につき継続。
  • Hover すると表示されるメニューをクリックするとどこからともなく (Content-Disposition で) ダウンロードが開始されるというクソ仕様なのでどうすんだこれ・・・とおもったら Page.hover() method があるじゃん!Puppeteer すごい!
  • ダウンロードとかどう処理されるのだろうか・・・とおもったが headless ブラウザなので普通にダウンロードされるらしい。ダウンロード先どこやねん、というと、裏口API を使う。なるほど・・・。
  • 動いた!すごいぞ Puppeteer!
  • Node.js 16: setTimeout with async/await | LinkedIn
  • 古い方法で書いてしまったので後で書き直そう。

2023-02-27

  • 04:25. つづきやんぞ。
  • 更にいくつかの setTimeout() と retry を追加したところ、動き出した。
  • とおもいきやまたコケる。そのたびに適当なワークアラウンドを足す、の繰り返しである。この retry は higher order function で書き直したいが、それよりはさっさと片付けたい気持ちが先立ってしまうな。
  • しかし一日あたり 100-200+MB くらいのデータが 200 日分ある。Google Photos にアップロードしようかと思ってたけど、ちょっとでかい。そういえばむかし secon.dev で JPEG を WEBP に圧縮する話をみたな。全部おわったら真似してみよう。
  • PC の auto suspend を一旦 off にしておく。そして待ってる間やることもないので Google Photos の API でも調べるか・・・。
  • Library API overview  |  Google Photos APIs  |  Google Developers
  • Shutterfly scraping の 10x くらいめんどくさそうだな。CLI のツールとかないだろうか・・・。と調べるとあるにはあるが、あまり手堅い様子ではないなあ。
  • gphotosuploader/gphotos-uploader-cli: Command line tool to mass upload media folders to your google photos account(s) (Mac OS / Linux) これはどうかな?アップロードの仕方がドキュメントされてない・・・が、 API をたたくかったるさを考えるとこれを使うのが良さそうである。機能リストをよむと色々実装しなければいけないことがわかって尚更。そして上の secon.dev の記事もよく見ると同じツールを使っていた。
  • それにしても最近のプリスクールはアプリベースのサービスを使ってるところが多いけど、それで Web UI がない日には scraping とかできなそうじゃない?どうするんだろうね。というかどうもしないのだろうけれども。
  • なお学校の写真というのは別にポーズ取らせたりせず遊んだり作業したりしてるのを邪魔しないように遠くから撮ってるだけなので、そんなには面白くない。しかもつい最近まではマスク着用のため尚更である。あと割と無理にズームでよっている。電話機は Pixel 6a を使ってくれておりありがたいけれど、Pixel 7 Pro を進呈したい気になる。これは absurd でありながら過去に何度か真面目に考えたけど、もう電話機部門勤務ではなくなってしまったので、さすがにナシだな。
  • 時間切れ。ダウンロードの進捗は 1/3 くらい。途中でコケ無い限り、今日中にはおわることでしょう。
  • 勤務開始直前。終わってる。そして 50GB くらいあるなどうするべこれ・・・。圧縮して半分になってもちょっと Google Photos には置きたくないサイズである。気分的には 10GB くらいが budget なので、downsample して 1/5 くらいになってもらうかなあ・・・。Shutterfly がサ終したくなるのも無理はない。

2023-02-28

  • 04:45. ねすごし…
  • とりあえずダウンロードした写真は zip にでもして作業ディレクトリ外に避難しましょう。本来なら GCS にでも避難したいところだが、でかすぎて時間かりそうなのでまた別の機会。
  • xargs で時間を溶かし、Python に避難。シェル力が低すぎる・・・てか最初から Python で書いていれば並列化とかもできただろうに・・・むしろ TS で書くべきだったか・・・。
  • はーやんなっちゃうぜ時間切れ。
  • しかし冷静に考えて Google Photos に 200 個以上もアルバム作っちゃうのだろうか自分。狂気なのでは。
  • Delete all photos from an album from Google Photos : googlephotos そうだよねアルバム消しても写真消せないよね。やはり preschool 写真を共有目的で Photos にアップロードするのは危険すぎるな。Drive 使うほうが良いかなあ。一個くらいやってみるべきか。
  • prasmussen/gdrive: Google Drive CLI Client こういうのを使うらしい。Google Drive は directory based な permission がないせいでほんとこういうの nervous でやだな・・・。
  • ていうか皆様 iPhone で Mac なのだから Google Photos を経由しない時点で WEPB 使えないじゃん。終了。HEIF … と一瞬思ったが今度は自分が見れんわ。これが first world social divide というものです。
  • 覚悟を決めて 50GB をアップロードするしかない。まあ一時的なものなのでいいです・・・。
  • 明日は podcast の公開作業をしなければなりません。

Accepting The Funny Mediocrity

2 年前に書いた Having Fun on The Dead Carrier は思ったより正しかった。けれどまだ板についていない。

8 年くらい前、それまで Web に傾倒していた反動で Android アプリプログラマに鞍替えした。結局モバイルはそれほど好きでないと思いつつ今日に至っている。ML やクラウドといった世の流行りに沿った仕事ができる日はこないだろうし、勤務先はともかく一般にモバイルエンジニアの給料は低い。だから異業種も同業種も転職のあてはない。なら今の職場で出世できないかと頑張ってみたが器でないことがわかった。

もはや仕事には大きな変化を期待していない。今のような業務が、少しずつ姿を変えながら、少しずつ給与を下げながら、ずっと続くのだろう。続くならまだいいが、勤務先でもレイオフが起きた。もはや継続性すら疑わしい。レガシー分野のプログラマ、将来が不安。

日々の業務が嫌というわけではない。チームを移ったばかりで ramp up するストレスはあるにせよ、理不尽なことにイライラしたり退屈すぎてうんざりといったことはない。ぼちぼちコードをかいて、ミーティングとかで人と話したりして、他人のドキュメントやコードをレビューもして、定刻に職場を出て家に帰る。20 代や 30 代のような熱意はないが、嫌でもない。コードを書いて何かが動けば多少の満足はある。レイオフは、今のところやり過ごせた。日々は平凡なりに滞りない。

憂鬱なのは将来を考えるときだ: 大きなことを成し遂げることはないだろう。大きな何かに立ち会うこともない。かつてのように夢中で働くこともない。でも、それがキャリアの帰結なので仕方ない。ぱっとしませんでした、残念でしたね。というだけ。

スキルがレガシーで、特定大企業に最適化されていて、その企業の先行きは不安。しかし現代的で勢いのある職場・職種に鞍替えする資源やリスク予算がない。息苦しい。「仕方ない」とは言いたくないが、自分のパラメタを鑑みて現状を選んでいる。より良い答えは特にない。ぱっとしない中年、将来が不安で息苦しいですね、というだけ。

一年の終わりやはじまりに我が身を振り返り将来を思うと、憂鬱が露わになる。それをを拭うことはできないかと考え、できないと思い至り絶望する。何度も何度もこれをループして時間を溶かし、心をすり減らせる。不毛。


業務でない課外活動は将来への準備だと思っていた。けれど準備が実ったことはない。大した準備もできなかった。少しばかり課外活動をしたくらいで将来有望な仕事に鞍替えできはしない。暇も体力もない自分が、暇で元気な若者が注ぎ込む湯水のような時間の勢いに競り勝てるはずがない。(これはぱっとしないなりに結果を出した裏返しでもある。全てを投げ出し新しい分野に掛け金を突っ込むよりは目先の仕事を続けたほうがマシと考えているのだから。)

新しい仕事のために新しいテクノロジを学ぶ – そんなファンタジーがなくなると「将来への準備」はただ気が重い。出世のための本を読む。LeetCode でレイオフに備える。希望を呼び起こしてくれた課外活動が、不安と憂鬱を反芻する時間になる。とても続けられない。無念や不安と毎日向き合う根性は無い。

準備はもういやだ。キャリアの残念さや、将来の不安や、根性のなさは受け入れるから、課外活動くらい楽しいことをしたい。それが Having Fun on The Dead Carrier だった。この結論は今も変わらない:

職業プログラマとしてのキャリアが冴えない結末を迎えるとしても、迎えるからこそ、そのキャリアを通じて発見した価値を大切にしたい。新しいテクノロジを触る刺激。コンピュータサイエンスのセンスオブワンダー。プログラミングの充足感。枯れ果てた未来の水やりに追われてこの美しい園を失ってしまったらあまりに悲しい。

日々の業務はきんとやるとして、その外では楽しいこと、役に立たない学びのあることを好きにやる。課外活動は将来のキャリアへの準備ではなく、キャリアから得た楽しみの養生。この二つが交わらないのは残念だが、交わらない以上どちらかを選ぶ必要がある。


トレードオフ。

課外活動では、被雇用準備による将来収入の改善という金銭的な利得を、価値観の養生という Well-being と引き換えている。根性がなく、頑張ってなにかやるのが高く付く(頑張れない)のでこのトレードオフを選んでいる。

昼の仕事では、やりがいや裁量といった個人的な関心を引き換えに、払いの良さという金銭的な利得と9時5時労働という時間的な利得を選んでいる。家族を養う稼ぎの必要性と家事子守という家庭の責務からこのトレードオフを選んでいる。

この二つを組み合わせると、昼の仕事で金銭を選ぶ代わりに課外活動で金銭以外を選んでいるとも言える。トレードオフとしては妥当な範囲と言えるんじゃないか。

トレードオフが必要という事実、つまり仕事のやりがいと収入が両立しなかったり、課外活動の充足と将来の準備が両立しないのは残念だが、それがまさにキャリアの失敗であり、ぱっとしなさなわけじゃん。それを無視してうまく行っているフリをしたら、家庭や Well-being や金銭を予期せぬ形で損ねてしまう。金銭は家庭や Well-being の足場なので、結局は家庭と Well-being を選んでいる。書いてみるとあたりまえの話だった。


もっと根性や計画性や先見の明があってキャリアをうまく積み上げられればよかったとは思う。けれどそうした後悔で日々を惨めなものにしたくもない。だから Have Fun と繰り返し言い聞かせ、選んだ現実を日常に塗り重ねていく。

In 2020s, Don’t Listen to Java Haters

To me, the book “A Philosophy of Software Design” was hard to go through.

An example of many frustrations: When talking about a hypothetical HTTPRequest class, the author first shows the “bad” version of an API:

public Map<String, String> getParams() { … }

And criticism is:

This method is shadow, and exposes the internal representation used by the HTTPRequest class to store paramters. Any change to that representation a change to the interface, …

Okay, what’s the alternative then?

Here is a better interface for retrieving parameter values:

public String getParameter(String name) { … }
public int getIntParameter(String name) { … }

getParameter returns a parameter value as a string. It provides a slightly deeper interface than getParams above; more importantly, it hides the internal representation of parameters. getInParameter converts the value of a parameter from its string form in the HTTP request to an integer. This saves the caller from having to request string-to-integer conversion separately, and hides that mechanism from the caller. Additional methods for other data types, such as getDoubleParameter, could be defined if needed.

Ouch.

  • If you are bothered by converting String to int, you shouldn’t program in Java1. Whether you like it or not, composing small methods is a way to write Java code. Going against the community norm has a price, and the author doesn’t seem aware of it.
  • Talking about awareness, I’m not sure the author is aware that Map is an interface and doesn’t have to be an “internal representation”. This signals the insufficient competence of the author as a Java programmer.

There are a lot like these. Zooming out, the hate for the convention of the Java community, and some of today’s programming practices (which are more modern than Java’s) permeates throughout the book. It seems that the author is primarily using C++. Also, his suggestions feel more applicable to C++ than to Java.

If so, the author should have used C++ instead of Java. If you don’t like Java, why bother? Everyone knows it’s a language out of fashion. Maybe the author thought Java was still more appealing than C++ to the general audience or their students? I have no idea.

Because of this dissonance, I have a hard time trusting the author – If the author thinks they know what they actually don’t, are his claims actually trustworthy?


But for the sake of a better review, let me mute my loud disbelief.

The problem with this book is that it claims the suggestions are generalizable when they don’t. Each programming language has its own trade-off, from the grammar to the runtime to the ecosystem. Things that matter for C++ won’t matter in Java, Python, or more modern languages.

My sense is that the suggestions in this book aren’t even appropriate for today’s C++. However, it makes more sense for thicker API boundaries like OS system calls and RPCs/REST where type systems are limited and programming language matters less. Ideas like “Deep module” and premature generalization can shine in this worldview.

This observation aligns with who is praising the book: Apparently, people around distributed systems and infrastructure platforms like this book a lot. In that world, the programming language does matter less: Things are polyglot and the boundaries between modules are thicker there.

On the other hand, to someone who works on a big monolithic code base written in non-C++, this book is baffling.

If this book were titled something like “A philosophy of platform modularization and API design” and was written with that focus, dropping all the irrelevant rumblings, it could have come out great and I might have loved it3.


It is OK to write code with minimum utilization of the language-specific features. Such an attitude was common until the early 2000s when the mainstream languages were poor. It is still okay sticking that same style today, but I don’t think that is what a reader expects from a book published around 20202.

Also, it’s fine to criticize Java. In the late 2000s, there was a large disappointment in Java. It accelerated the adoption of “lightweight” languages like Ruby, Python, and JavaScript. It also prompted the rise of modern statistically typed languages like Go and Kotlin.

But if you do criticize, do it well. What “A Philosophy of Software Design” did is less than talking two decades past. As a reader, I expect something better.

Talking about the reader’s expectations, chapter 19, “Software Trends”, is truly a killer. Why are you talking about OOP, Agile, and Design Patterns as trends now? Pleaaase!

Footnotes

  1. You should use Kotlin – I’m kind of kidding.
  2. The first edition was published in 2018.
  3. Here is another and narrower criticism of this book I wrote before. I won’t write another one.

Link: “The worst part of this is that everyone at GitHub is now forced to use Microsoft Teams.”

The worst part of this is that everyone at GitHub is now forced to use Microsoft Teams.

GitHub to layoff 10% and closing all offices | Hacker News

I haven’t used Teams and am not sure why it gathers that much hate. I’ve been “forced” to use Google Chat. It’s not as good as Slack I guess, but I’m fine with it.

Why do people love Slack so much? Do you like workspace chat in general? I like group chat but only if it’s private and among friends.

A Corner to Breathe

I haven’t taken a “real” break at work since I moved to the new office. The building of the new office is small and packed. It doesn’t give me either space or anonymity. The real break needs both – You need space where no one notices you, where you can take a breath and let your mind dress down.

Luckily, or by design (to the credit of the employer), there is always space. Many buildings have a few corners with sofas or stools. What’s missing is anonymity. So I walked to the building next to my new office, lurking around, and found this:

This is the perfect corner to have a break:

  • Nobody in my team will come here. Nothing fancy is around.
  • Nobody is stopping here. People tend to choose somewhere close to drinks and snacks. It’s on the other side of the building.

This place is too bland for the tastes of many, and that creates the anonymity I need. It has moderate foot traffic and therefore is not super silent, but that’s fine. I’m not asking much. Or I can keep searching for even more perfect corners if I desire. For now though, this will suffice.

When you move, you lose something subtle you don’t notice. You might need a checklist to pick it up again, and this is the first item of that list: Find a corner to breathe.

Peak and Bubble

During the tax return prep, I found my total income declined 10+ percent last year. This is primarily because of the stock price drop.

Next year or the year after, my income will fall, possibly another 10+ percent, this time because of lower performance ratings1. I had a long tenure in my last team and my previous manager gave me a high rating. As I moved to a new team starting a new role, the good rating is unlikely to sustain.

This is not a pessimism. It’s just a phase I have to go through. It happened the last time I moved, although, unlike this time, the stock growth softened the impact. That won’t be the case this time.

A slightly pessimistic twist: I’m not sure if I can “recover” my rating. I think my nice rating reflected a good opportunity I had, which is not common these days in hindsight. Also, my energy level has fallen for years. I’ll do my best to keep up, but don’t expect much.

This means that: 2021 was probably the year when my income hit its peak. I won’t see that price tag again in my career.

This might sound sad, but I am not that disappointed. I rather feel a kind of gratitude. The tech sector has been in a longstanding bubble, and we are all the tulips. I’m glad I was able to experience this bubble. It wouldn’t have happened if I wasn’t here. This is a sheer fortune.

And now, the party is coming to an end2.

The bubbles did feel nice. They were just a bit slippery, as are their residues. From now on, I have to walk a bit more slowly so as not to stumble.

Footnotes

  1. In addition to an extra stock price fall which is pretty much possible.
  2. Another party is starting, but I don’t think I’m in the room.

Link: Ask HN: Suggestions for working effectively with junior devs at FAANG | Hacker News

I’m a senior dev at one of the FAANGs with more than 15 years of experience, but the rest of my team consists of devs with an average of 2 years of experience. At first when I joined, I thought this was an aberration, but there are many teams around me that are structured similarly. Is this how FAANGs try to scale teams?

Ask HN: Suggestions for working effectively with junior devs at FAANG | Hacker News

The top comment:

And in general, there are two ways to go. The first is to accept the fact that many senior engineering and most staff engineering gigs are more about this kind of mentorship approach than actually doing work. And basically accept that the prime “getting shit done” years of your career are done and you will mostly be working in this new way now.

Unfortunately you will either need to change your attitude or change teams. In y… | Hacker News

One day I pointed out the massive amount of the code and design doc reviews the TL of my team is conducting every day, to the TL himself. His response was something like the top comment.

According to him, he used to do everything but that wasn’t sustainable. He was told to “delegate”, and in my guess, to mentor. That is what he’s doing these days.

I cannot articulate what I think here. He’s a good mentor, a good lead, and I appreciate that, but…?

Monica

Personal CRM done right – Monica

Yuko and I started using the Monica Personal CRM a few months back. We find it useful. Today It has about 140 contacts and about 150 activities recorded. The number keeps growing. Let me walk through how we use it and whether it can be helpful to you.

TLDR: We like it but I don’t strongly recommend it because of its niche nature.

What Is Monica?

Monica is CRM, that is, an address book with richer metadata. You keep records of people with their names, birthdays, relationships (who is married to who, and whose parents are who, etc.), notes, and other attributes.

  • In the parenting context, I tend to recognize other parents as nameless, saying, “Mike’s dad”. This is problematic in the first name culture, and not very respectful even outside the cultural radius. Monica helps me remember their names1.
  • The birthdays of the child’s friend circle are important for gifting purposes.
  • Some other basic attributes are also worth tracking: Their current and past jobs, where they are from, how we met them, etc. These are often mixed up if you don’t take notes, and such a mix-up can cause some minor embarrassment.

It is also a journal. You keep records of activities you did with these people: Went where with whom, who said what, who gave us which, and vice versa, etc. You can look back at these chronologically and it helps since:

  • This is another form of metadata, but you don’t have to organize it in any canonical way. All you have to do is add a journal entry with people tagged.
  • The memory of the conversation evaporates quickly if you take notes, and you’ll have to ask the same questions again and again. The activity log reduces that social awkwardness.
  • You share the conversations with your spouse. Although you can do it over the dinner table, having the written records is a nice addition.

Asking Personal Questions

For me, one unexpected benefit is that I became more curious about other people.

I thought I was indifferent to other people and often forgot what they told me because of my indifference. This indifference has amplified my social awkwardness.

However, I realized that I was indifferent because I forgot. I was afraid of asking personal questions partly because I forgot what I heard and I had to ask the same questions again and again. I feard the awkwardness and the fear made me more indifferent to other people2.

Monica gives me a place to take notes, therefore making me less forgetful – I can just take note of what I heard. It becomes my assisted memory.

Once you unlock to ask personal questions, small talks become a bit easier. “How are you doing” becomes a source of a journal entry in Monica. I don’t say I become a more interesting person, but at least I become more interested in the other side of the talk. That does help.

Even better, it is also our assisted memory: I can share my findings with my spouse. This collective nature makes the memories more useful and robust.

Is Monica Worth It?

Monica isn’t for everyone. First of all, not everyone needs personal CRM. Some people are just good at remembering this kind of people’s details super well. Others are not, but they don’t care. You want something like Monica only if you’re in the narrow window of a “not good at this but do care” personality.

Even if you are in that window, adopting Monica can be a high bar:

  • The membership is expensive – $9/month. Monica is open source and some people choose self-hosting because of the price.
  • The UI design is outdated and some important features like full-text search are missing.
  • They don’t have mobile apps.

They are working on a new version and I hope it’ll fix the feature parity and UI problems, but the price will be the same. Niche products are expensive.

Still, we will stay on Monica because:

  • It allows sharing notes with family. This isn’t free with more mainstream tools either. For example, Notion costs as much as Monica ($8/m) if you want the collaboration bit.
  • The dedicated UI is better than the generic UI (say, Notion or Spreadsheet).
  • We know we use it somehow.

I tried other mainstream tools but none did suit well enough to stick.

I hoped there were less-niche options than this. In fact, we used to use Highrise from 37sinals. But they sunset it3 a while back. There are some others in this genre, but none are for families. Apparently, family-oriented CRM isn’t a big-enough market.

Overall, I wouldn’t strongly recommend Monica to anyone. It’s a bit too niche and too indie.

I’d rather ask other families how they keep up with the growing flow of relationship-oriented information. Am I just too bad to remember these relationship things?4

Footnotes

  1. Without asking my spouse about their names which are in her text archive.
  2. Besides the fundamental indifference I have. I have accepted that to some degree.
  3. To their credit, they’re still running the app. But no updates are available anymore.
  4. I don’t want to believe it, but I kind of know the answer.

Link: Actually, Japan has changed a lot – by Noah Smith

There are some interesting numbers in the first article.


Every time I find Japan-related posts in places like HN, I realize how little I know about Japan. I stopped paying attention to Japan-related news when I moved to the Bay Area, but I admit that I didn’t pay attention either even when I was in Tokyo.

I was a typical single nerd male who didn’t read the news. And I’m not sure I should have read more – What was the point of being informed if the only choice was to live in Japan and (although I didn’t realize) I was in a pretty privileged position? Well, there were points, but there were other priorities.

Now being an expat with a hypothetical option to move back or not, should I read more about Japan? I still don’t know. Such a decision is probably led more by local and personal context than the global, objective parameters like GDP or mortality rate.

If that’s the case, why do I subscribe to NYT and read the U.S related news? Isn’t living in the Bay Area a personal, local choice? (It is.) That’s a fair question. I used to think that this is a survival strategy as an expat and that there are also some moral values, again as an expat, to be aware of the local habitat, and to blend in.


For some reason, these points don’t feel as convincing as they used to be. Nowadays I rather read it just because it’s interesting enough at a pass time. They have good writers and some articles are deeply researched and well-written. I didn’t have that feeling when I was reading newspapers in Japan. Also, exposing myself to the American value system still feels fresh to me.

This too is very subjective. I consider myself a very picky Japanese reader who has strong taste. And I consider myself a very mediocre and slow English reader who has less than middle-school vocabulary size. This fluency gap surely biases my judgment here.

It’s ironic that I read less because I can read more. Maybe what I should do is read The Japan Times or Nikkei Asia. It sounds as ridiculous as it can go. But just by visiting the site, I learned Toyota’s CEO is stepping down which is a big deal, I guess?

Link: Remote Workers Face a Lonely Wave of Layoffs – The New York Times

But management experts stress that businesses don’t have to navigate periods of economic turbulence so haphazardly.

Ms. Sucher noted that Nokia, when it was restructuring in 2011, gave the roughly 18,000 people who would be affected about a year of advance notice and offered them several pathways forward: The company would help them find new roles internally, get new jobs externally, start their own businesses or begin an educational program, among other options.

Nokia’s success metrics were whether people had a job lined up when they left the firm, and whether they were leaving with a positive enough impression that they would be open to returning in the future. Nearly two-thirds of people who left knew what their next steps would be.

Remote Workers Face a Lonely Wave of Layoffs – The New York Times

This sounds very European. Although I hope my employer and the peer companies did this, they are too American to behave like this.

According to Wikipedia, Nokia is kind of fine after they sold the mobile division to Microsoft.

Lifer

A month ago I wrote this but somehow didn’t publish it.

I feel I’m becoming a Lifer at Google. If you work for a single company long enough that you can imagine yourself retiring at that company, you are a Lifer.

I’m here at Google more than twelve years. That’s long enough for me to become a Lifer, I guess. It’s kind of a shame. When I moved from Japan to the US, I wanted to experience more diverce careers. That didn’t happen.

I’m old enough to be OK with it but it feels weird. Before I arrived at this place, I was a hopper and had never worked at any single company for more than three years.

A month ago it was disappointing to recognize me as a Lifer. Today it is scary. I can still imagine myself retiring here. What I find not able to do anymore is picture any other non-devastating future. And we just learned that life here can end at any time for no reason.

I want to ask Lifers elsewhere – What’s it been like to be one at, say, IBM? How about Adobe, Microsoft, Apple, or HP? Please tell me it is okay. Tell me you are okay.


This was such an insensitive, selfish and cowardly rumbling. There are people who lost their jobs. I should just collect the pieces and move on. That’s the right thing to do here.

I’ll leave this post alone to mark my wimp.

Agile Roles

Capital One cuts over 1,000 roles in Technology • The Register (Also HN)

The consumer lending company told The Register that its plan was to eliminate its “Agile” job family and integrate staff there into “existing engineering and product manager roles.”

As someone who worked in the Japanese IT industry, I used to be wondering how Agile was adopted in the U.S. and why it had collected so much hate.

I then learned that many companies not only hired Agile consultants but also had full-time “Agile roles” like Scrum Masters. There are even certificates for these professions. Hiring more people to run the process didn’t feel like lower-case “agile”, and that was probably one of the reasons why the upper-case “Agile” was disliked.

This upper-case Agile was not as common in Japan, and I suspect it is still the same. I preach this fact because, to me, Agile was always a grassroots movement. It was hard to imagine what a full-time Agile role was like. I still don’t understand.

Today, before I figure it out, the era of the upper-case Agile seems to be ending.

You would point out that the statement from Capital One is just an excuse. Maybe. Partly at least. On the other hand, I smell a pinch of truth; There are countless ways to cut and excuse, and they choose the above from the endless options.

You may then wonder if the lower-case agile is also ending. I hope not. The statement says:

The Agile role in our Tech organization was critical to our earlier transformation phases but as our organization matured, the natural next step is to integrate agile delivery processes directly into our core engineering practices

As an ex-grassroots-agile-believer, I’m too biased to question this. I’d rather ask you what you see from your trench. Is the lower-case agile dead, or is it “integrated”?

Link: Tell HN: It is impossible to disable Google 2FA using backup codes | Hacker News

The solution (which is too late to help you with now) is to take a photo of the QR code that is first showed to you when you originally set up 2FA. Keep that safe somewhere and you can always go back. For anyone who is freaked out by this and currently still has access to their google Authenticator app, I suggest exporting all your codes to a big QR code in the app and keep that safe (maybe print it out).
https://news.ycombinator.com/item?id=34442690

Printing it out and putting it in some safe is what i did.

And works like a charm.

I mean, if it works for crypto wallets it might also work for 2FA…

https://news.ycombinator.com/item?id=34443283

This is why I use SMS as my second factor for my Google account. Much harder to lose. It could be vulnerable to sim swapping attacks, but I consider Google locking me out of my own account a more likely threat (and frankly I’m probably not a high-profile enough target for anyone to bother with that, and in any case they’d still need my password).

https://news.ycombinator.com/item?id=34442690