It could be ram problems. Try physically removing the ram module then re-seating it and also making sure the insides of the PC is as dust free as possible. If still the same (some CPU's will throttle in if temps go high) run the memory diagnostic tool. Link.
Surface Pro (2017) vs Surface Pro 4